Permalink
Browse files

Set up install on quit for critical automatic updates too

Fixes the SUInstallLaterChoice for critical update prompts.
  • Loading branch information...
1 parent e6deed9 commit bc458a6ab5e099589f25b3261ea5a965cbcbabdf @mattstevens committed Feb 12, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 SUAutomaticUpdateDriver.m
@@ -38,14 +38,15 @@ - (void)showUpdateAlert
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil];
+
// If this is marked as a critical update, we'll prompt the user to install it right away.
if ([updateItem isCriticalUpdate])
{
[self showUpdateAlert];
}
else
{
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil];
showUpdateAlertTimer = [[NSTimer scheduledTimerWithTimeInterval:SUAutomaticUpdatePromptImpatienceTimer target:self selector:@selector(showUpdateAlert) userInfo:nil repeats:NO] retain];
}
}
@@ -64,6 +65,7 @@ - (void)invalidateShowUpdateAlertTimer
- (void)dealloc
{
+ [self stopUpdatingOnTermination];
[self invalidateShowUpdateAlertTimer];
[alert release];
[super dealloc];

0 comments on commit bc458a6

Please sign in to comment.