Fix Autoupdate.app crash on 10.7 (issue #441)

Autoupdate.app can crash in the middle of installing an update, leaving
the user with a broken application. The crash is caused by the status
window’s controller (SUStatusController) being prematurely deallocated
before the window is closed. This change prevents such a crash by
keeping a strong reference to the SUStatusController in
TerminationListener.
This commit is contained in:
Chris Campbell committed 2015-01-14 11:42:33 -05:00
1 parent 6dc6240fab
commit b5fc2be113
1 file changed
+6 -1
+6 -1
View File
@@ -32,6 +32,7 @@ static const NSTimeInterval SUParentQuitCheckInterval = .25;
@property (strong) SUHost *host;
@property (assign) BOOL shouldRelaunch;
@property (assign) BOOL shouldShowUI;
@property (strong) SUStatusController *statusController;
- (void)parentHasQuit;
@@ -86,6 +87,7 @@ static const NSTimeInterval SUParentQuitCheckInterval = .25;
- (void)dealloc
{
[self.longInstallationTimer invalidate];
[self.statusController close];
}
@@ -152,7 +154,10 @@ static const NSTimeInterval SUParentQuitCheckInterval = .25;
[statusCtl beginActionWithTitle:SULocalizedString(@"Installing update...", @"")
maxProgressValue: 0 statusText: @""];
[statusCtl showWindow:self];
}
[self.statusController close]; // If there's an existing status controller, close it before we release our strong reference to it.
self.statusController = statusCtl; // Keep a strong reference to the status controller, or else it might get prematurely deallocated.
}
[SUInstaller installFromUpdateFolder:self.folderpath
overHost:self.host