diff --git a/sparkle-cli/SPUCommandLineDriver.m b/sparkle-cli/SPUCommandLineDriver.m index 04dcfad7..6903cc3c 100644 --- a/sparkle-cli/SPUCommandLineDriver.m +++ b/sparkle-cli/SPUCommandLineDriver.m @@ -57,27 +57,20 @@ return self; } -// Because the user driver dispatches to the main queue asynchronously, we should do so here too -// to preserve the order of handled events - -- (void)updater:(SPUUpdater *)__unused updater willScheduleUpdateCheckAfterDelay:(NSTimeInterval)delay +- (void)updater:(SPUUpdater *)__unused updater willScheduleUpdateCheckAfterDelay:(NSTimeInterval)delay __attribute__((noreturn)) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (self.verbose) { - fprintf(stderr, "Last update check occurred too soon. Try again after %0.0f second(s).", delay); - } - exit(EXIT_SUCCESS); - }); + if (self.verbose) { + fprintf(stderr, "Last update check occurred too soon. Try again after %0.0f second(s).", delay); + } + exit(EXIT_SUCCESS); } -- (void)updaterWillIdleSchedulingUpdates:(SPUUpdater *)__unused updater +- (void)updaterWillIdleSchedulingUpdates:(SPUUpdater *)__unused updater __attribute__((noreturn)) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (self.verbose) { - fprintf(stderr, "Automatic update checks are disabled. Exiting.\n"); - } - exit(EXIT_SUCCESS); - }); + if (self.verbose) { + fprintf(stderr, "Automatic update checks are disabled. Exiting.\n"); + } + exit(EXIT_SUCCESS); } // If the installation is interactive, we can show an authorization prompt for requesting additional privileges, @@ -99,24 +92,20 @@ // In case we find an update during probing, otherwise we leave this to the user driver - (void)updater:(SPUUpdater *)__unused updater didFindValidUpdate:(SUAppcastItem *)__unused item { - dispatch_async(dispatch_get_main_queue(), ^{ - if (self.probingForUpdates) { - if (self.verbose) { - fprintf(stderr, "Update available!\n"); - } - exit(EXIT_SUCCESS); + if (self.probingForUpdates) { + if (self.verbose) { + fprintf(stderr, "Update available!\n"); } - }); + exit(EXIT_SUCCESS); + } } -- (void)updaterDidNotFindUpdate:(SPUUpdater *)__unused updater +- (void)updaterDidNotFindUpdate:(SPUUpdater *)__unused updater __attribute__((noreturn)) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (self.verbose) { - fprintf(stderr, "No update available!\n"); - } - exit(EXIT_FAILURE); - }); + if (self.verbose) { + fprintf(stderr, "No update available!\n"); + } + exit(EXIT_FAILURE); } - (void)updater:(SPUUpdater *)__unused updater didAbortWithError:(NSError *)error