Ensure install handlers are invoked on main queue (#2235)

This commit is contained in:
Zorg authored and GitHub committed 2022-08-22 18:23:23 -07:00
1 parent f5d4ad52ca
commit f46ea87380
2 files changed
+6 -3

No files matched your search

+3 -1
View File
@@ -110,7 +110,9 @@
if (self.willInstallSilently && [updaterDelegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationBlock:)]) {
__weak SPUAutomaticUpdateDriver *weakSelf = self;
installationHandledByDelegate = [updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationBlock:^{
[weakSelf.coreDriver finishInstallationWithResponse:SPUUserUpdateChoiceInstall displayingUserInterface:NO];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.coreDriver finishInstallationWithResponse:SPUUserUpdateChoiceInstall displayingUserInterface:NO];
});
}];
}
+3 -2
View File
@@ -321,8 +321,9 @@
__weak __typeof__(self) weakSelf = self;
[self.userDriver showInstallingUpdateWithApplicationTerminated:applicationTerminated retryTerminatingApplication:^{
if (!applicationTerminated) {
__typeof__(self) strongSelf = weakSelf;
[strongSelf.coreDriver finishInstallationWithResponse:SPUUserUpdateChoiceInstall displayingUserInterface:YES];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.coreDriver finishInstallationWithResponse:SPUUserUpdateChoiceInstall displayingUserInterface:YES];
});
}
}];
} else if ([self.userDriver respondsToSelector:@selector(showInstallingUpdateWithApplicationTerminated:)]) {