mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
SUUpdater: Delay updater startup
This should allow configuring the updater in willFinishLaunching: Should fix #1505
This commit is contained in:
1 parent
d9cce796cb
commit
0cd3aa0d9d
1 file changed
+9
-5
Vendored
+9
-5
@@ -80,11 +80,15 @@ static NSMutableDictionary *sharedUpdaters = nil;
|
||||
_userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:bundle delegate:self];
|
||||
_updater = [[SPUUpdater alloc] initWithHostBundle:bundle applicationBundle:bundle userDriver:_userDriver delegate:self];
|
||||
|
||||
NSError *updaterError = nil;
|
||||
if (![_updater startUpdater:&updaterError]) {
|
||||
SULog(SULogLevelError, @"Error: Failed to start updater with error: %@", updaterError);
|
||||
abort();
|
||||
}
|
||||
// Delay starting the updater, so that the host has a chance to configure the updater
|
||||
// either in applicationWillFinishLaunching: or by setting properties right after initialisation
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
NSError *updaterError = nil;
|
||||
if (![_updater startUpdater:&updaterError]) {
|
||||
SULog(SULogLevelError, @"Error: Failed to start updater with error: %@", updaterError);
|
||||
abort();
|
||||
}
|
||||
});
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user