Dispatch reply blocks to main queue

This commit is contained in:
Zorg committed 2016-02-27 16:41:05 -05:00
1 parent fbfcbbdf2d
commit dec088b9ad
2 files changed
+8 -4

No files matched your search

+3 -1
View File
@@ -42,7 +42,9 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
self.interruptible = NO;
[self.updater.userUpdaterDriver showAutomaticUpdateFoundWithAppcastItem:self.updateItem reply:^(SUAutomaticInstallationChoice choice) {
[self automaticUpdateAlertFinishedWithChoice:choice];
dispatch_async(dispatch_get_main_queue(), ^{
[self automaticUpdateAlertFinishedWithChoice:choice];
});
}];
}
+5 -3
View File
@@ -234,11 +234,13 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
NSTimeInterval delayUntilCheck = (updateCheckInterval - intervalSinceCheck); // It hasn't been long enough.
[self.userUpdaterDriver startUpdateCheckTimerWithNextTimeInterval:delayUntilCheck reply:^(SUUpdateCheckTimerStatus checkTimerStatus) {
switch (checkTimerStatus) {
case SUCheckForUpdateNow:
[self checkForUpdatesInBackground];
break;
case SUCheckForUpdateWillOccurLater:
break;
case SUCheckForUpdateNow:
dispatch_async(dispatch_get_main_queue(), ^{
[self checkForUpdatesInBackground];
});
break;
}
}];
} else {