From 160ed9c1a94b37ed8e93b8f013c9662c1a73b827 Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Mon, 20 Feb 2017 15:05:44 -0800 Subject: [PATCH] fixes --- Mixpanel/MixpanelExceptionHandler.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Mixpanel/MixpanelExceptionHandler.m b/Mixpanel/MixpanelExceptionHandler.m index 5e7cf3a33..de04a99e4 100644 --- a/Mixpanel/MixpanelExceptionHandler.m +++ b/Mixpanel/MixpanelExceptionHandler.m @@ -154,10 +154,20 @@ + (void) mp_handleUncaughtException:(NSException *)exception { // Archive the values for each Mixpanel instance for (Mixpanel *instance in handler.mixpanelInstances) { [instance archive]; - [instance track:@"App Crashed" properties:@{@"Reason": [exception reason], - @"Trace": [[exception userInfo] objectForKey:UncaughtExceptionHandlerAddressesKey]}]; + NSMutableDictionary *properties = [[NSMutableDictionary alloc] init]; + [properties setValue:[exception reason] forKey:@"Reason"]; + [properties setValue:[[exception userInfo] objectForKey:UncaughtExceptionHandlerAddressesKey] forKey:@"Trace"]; + [instance track:@"App Crashed" properties:properties]; dispatch_sync(instance.serialQueue, ^{}); } + + NSSetUncaughtExceptionHandler(NULL); + signal(SIGABRT, SIG_DFL); + signal(SIGILL, SIG_DFL); + signal(SIGSEGV, SIG_DFL); + signal(SIGFPE, SIG_DFL); + signal(SIGBUS, SIG_DFL); + signal(SIGPIPE, SIG_DFL); NSLog(@"Encountered an uncaught exception. All Mixpanel instances were archived."); NSLog(@"%@", [NSString stringWithFormat:@"Debug details follow:\n%@\n%@",