mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-29 05:24:26 +00:00
Fix potential hang with dispatch_sync to main thread
This commit is contained in:
1 parent
a18282ec79
commit
1c4bcda012
1 file changed
+8
-2
Vendored
+8
-2
@@ -241,11 +241,17 @@
|
||||
|
||||
- (void)extractUpdate
|
||||
{
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
dispatch_block_t updateUI = ^{
|
||||
// Now we have to extract the downloaded archive.
|
||||
[self.statusController beginActionWithTitle:SULocalizedString(@"Extracting update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
|
||||
[self.statusController setButtonEnabled:NO];
|
||||
});
|
||||
};
|
||||
|
||||
if (![NSThread mainThread]) {
|
||||
dispatch_sync(dispatch_get_main_queue(), updateUI);
|
||||
} else {
|
||||
updateUI();
|
||||
}
|
||||
[super extractUpdate];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user