From dec088b9ad664850bf9c24575f3ad5cbd9ef1fc3 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 27 Feb 2016 16:41:05 -0500 Subject: [PATCH] Dispatch reply blocks to main queue --- Sparkle/SUAutomaticUpdateDriver.m | 4 +++- Sparkle/SUUpdater.m | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index 092557c6..087a8b20 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -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]; + }); }]; } diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 0f377157..839fa467 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -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 {