From e27c5437ab72f2920cd52121ccc36c7a63d47b2f Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 20 Aug 2016 19:07:10 -0400 Subject: [PATCH] Resume the XPC connections after setting up invalidation handlers --- Sparkle/SUDownloadDriver.m | 4 ++-- Sparkle/SUInstallerDriver.m | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Sparkle/SUDownloadDriver.m b/Sparkle/SUDownloadDriver.m index 738c3a12..821ec924 100644 --- a/Sparkle/SUDownloadDriver.m +++ b/Sparkle/SUDownloadDriver.m @@ -82,8 +82,6 @@ - (void)downloadUpdate { - [self.connection resume]; - NSString *bundleIdentifier = self.host.bundle.bundleIdentifier; assert(bundleIdentifier != nil); @@ -116,6 +114,8 @@ }); }; + [self.connection resume]; + [self.delegate downloadDriverWillBeginDownload]; NSString *desiredFilename = [NSString stringWithFormat:@"%@ %@", [self.host name], [self.updateItem versionString]]; diff --git a/Sparkle/SUInstallerDriver.m b/Sparkle/SUInstallerDriver.m index 7869663e..31c52f64 100644 --- a/Sparkle/SUInstallerDriver.m +++ b/Sparkle/SUInstallerDriver.m @@ -317,7 +317,6 @@ } else { launcherConnection = [[NSXPCConnection alloc] initWithServiceName:@INSTALLER_LAUNCHER_BUNDLE_ID]; launcherConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerLauncherProtocol)]; - [launcherConnection resume]; launcherConnection.interruptionHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ @@ -347,6 +346,8 @@ }); }; + [launcherConnection resume]; + installerLauncher = launcherConnection.remoteObjectProxy; } @@ -373,7 +374,6 @@ } else { launcherConnection = [[NSXPCConnection alloc] initWithServiceName:@INSTALLER_LAUNCHER_BUNDLE_ID]; launcherConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerLauncherProtocol)]; - [launcherConnection resume]; launcherConnection.interruptionHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ @@ -405,6 +405,8 @@ }); }; + [launcherConnection resume]; + installerLauncher = launcherConnection.remoteObjectProxy; }