diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index a9c996fb..e1a4416c 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -340,7 +340,9 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, id - (void)checkForUpdatesWithDriver:(id )d { - if ([self updateInProgress]) { return; } + if ([self updateInProgress]) { + return; + } [self.userDriver invalidateUpdateCheckTimer]; @@ -353,10 +355,9 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, id } self.driver = d; - + // If we're not given a driver at all, just schedule the next update check and bail. - if (!self.driver) - { + if (!self.driver) { [self scheduleNextUpdateCheck]; return; } @@ -562,7 +563,9 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, id // Stop checking for updates [self cancelNextUpdateCycle]; - [self.userDriver invalidateUpdateCheckTimer]; + + // Don't tell the user driver to invalidate the update check timer + // It could always create a new updater instance once the scheduled time occurs // Abort any on-going updates // A driver could be retained by another object (eg: a timer), diff --git a/Sparkle/SUUserDriverCoreComponent.m b/Sparkle/SUUserDriverCoreComponent.m index 065728b8..82f98d48 100644 --- a/Sparkle/SUUserDriverCoreComponent.m +++ b/Sparkle/SUUserDriverCoreComponent.m @@ -218,7 +218,9 @@ [self cancelUpdateCheckStatus]; [self cancelDownloadStatus]; [self dismissInstallAndRestart]; - [self invalidateUpdateCheckTimer]; + + // We don't invalidate the update check timer here because that's not really a part of the installation + // and we might want to keep it still alive } - (void)invalidate @@ -230,6 +232,8 @@ self.installUpdateHandler = nil; self.updateCheckStatusCompletion = nil; + [self invalidateUpdateCheckTimer]; + // Dismiss the installation normally [self dismissUpdateInstallation]; }