0

Lately, I got a lot of crashlogs in Crashlytics and I don't really know why.

com.apple.main-thread
0  libsystem_kernel.dylib        0x1837dc60c __semwait_signal + 8
1  libsystem_c.dylib             0x1836f4f70 nanosleep + 212
2  libsystem_c.dylib             0x1836f4e90 usleep + 64
3  MyProject                     0x10336b554 -[MyViewController .cxx_destruct] + 2732324
4  MyProject                     0x1031d4424 -[MyViewController .cxx_destruct] + 1064948
5  MyProject                     0x1031d3ec4 -[MyViewController .cxx_destruct] + 1063572
6  MyProject                     0x1030e4c8c -[MyViewController .cxx_destruct] + 84060

[MyViewController .cxx_destruct] is called multiple times in multiple threads.

The crash is not repeatable for me. It seems to happen if the app was in the background for a long time. I'm also pretty sure, that the view referenced in the crashlog is not being displayed and probably never was! It's only a view "about the app" which is even pretty difficult to find for a user.

#import "MyViewController.h"
#import "Localization.h"
#import "AppData.h"

@interface MyViewController ()

@property (weak, nonatomic) IBOutlet UILabel *myLabel;
... and many more

@end

@implementation MyViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    //set logo, text and so on
    ...
}

#pragma mark - Action handler

- (IBAction)handleCloseActionPerformed:(id)sender {
    dispatch_async(dispatch_get_main_queue(), ^{
        [self dismissViewControllerAnimated:YES completion:nil];
    });
}

@end

The way users can open the view is with a click that executes the following code or by clicking a Bar Button Item.

NSString * storyboardName = @"Main";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"AboutViewController"];;
[self presentViewController:vc animated:YES completion:nil];
Yuliwee
  • 327
  • 1
  • 11

0 Answers0