From 64aaf2aa8cb5d64d0b7599a48b95624d6fc234aa Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Thu, 27 Aug 2015 10:18:13 +0200 Subject: [PATCH] Fix app update triggering exit not safely report When the app updates and the crash manager has `enableAppNotTerminatingCleanlyDetection` enabled, starting the update shouldn't trigger a crash report for that scenario. --- Classes/BITCrashManagerPrivate.h | 2 ++ Classes/BITUpdateManager.m | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Classes/BITCrashManagerPrivate.h b/Classes/BITCrashManagerPrivate.h index c1b6362189..5bb40500e2 100644 --- a/Classes/BITCrashManagerPrivate.h +++ b/Classes/BITCrashManagerPrivate.h @@ -103,6 +103,8 @@ - (void)setLastCrashFilename:(NSString *)lastCrashFilename; +- (void)leavingAppSafely; + @end diff --git a/Classes/BITUpdateManager.m b/Classes/BITUpdateManager.m index 4767b769a0..6ddf919163 100644 --- a/Classes/BITUpdateManager.m +++ b/Classes/BITUpdateManager.m @@ -42,6 +42,10 @@ #import "BITUpdateViewControllerPrivate.h" #import "BITAppVersionMetaInfo.h" +#if HOCKEYSDK_FEATURE_CRASH_REPORTER +#import "BITCrashManagerPrivate.h" +#endif + typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) { BITUpdateAlertViewTagDefaultUpdate = 0, BITUpdateAlertViewTagNeverEndingAlertView = 1, @@ -117,6 +121,10 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) { [self.delegate updateManagerWillExitApp:self]; } +#if HOCKEYSDK_FEATURE_CRASH_REPORTER + [[BITHockeyManager sharedHockeyManager].crashManager leavingAppSafely]; +#endif + // for now we simply exit the app, later SDK versions might optionally show an alert with localized text // describing the user to press the home button to start the update process exit(0);