Merge pull request #1117 from mentalfaculty/studies

Added a timer invalidation in a asynchronous callback.
This commit is contained in:
Kornel authored and GitHub committed 2017-08-10 13:45:18 +01:00
commit f27416c97c
1 file changed
+3
+3
View File
@@ -351,6 +351,9 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
[self.userDriver showCanCheckForUpdates:YES];
[self retrieveNextUpdateCheckInterval:^(NSTimeInterval updateCheckInterval) {
// This callback is asynchronous, so the timer may be set. Invalidate to make sure it isn't.
[self.updaterTimer invalidate];
// How long has it been since last we checked for an update?
NSDate *lastCheckDate = [self lastUpdateCheckDate];
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }