Skip to content

Commit

Permalink
santabs: Serialize calls to -[SNTBundleService createConnection] (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
tburgin committed Mar 12, 2018
1 parent bbe9f83 commit ce03611
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/santabs/SNTBundleService.m
Expand Up @@ -72,18 +72,18 @@ - (void)createConnection {
}

- (void)attemptReconnection {
[self performSelectorInBackground:@selector(createConnection) withObject:nil];
[self performSelectorOnMainThread:@selector(createConnection) withObject:nil waitUntilDone:NO];
}

#pragma mark SNTBundleServiceXPC Methods

// Connect to the SantaGUI
- (void)setBundleNotificationListener:(NSXPCListenerEndpoint *)listener {
SNTXPCConnection *c = [[SNTXPCConnection alloc] initClientWithListener:listener];
c.remoteInterface = [SNTXPCNotifierInterface bundleNotifierInterface];
[c resume];
self.notifierConnection = c;
dispatch_async(self.queue, ^{
dispatch_async(dispatch_get_main_queue(), ^{
SNTXPCConnection *c = [[SNTXPCConnection alloc] initClientWithListener:listener];
c.remoteInterface = [SNTXPCNotifierInterface bundleNotifierInterface];
[c resume];
self.notifierConnection = c;
[self createConnection];
});
}
Expand Down

0 comments on commit ce03611

Please sign in to comment.