Browse Source

safeguards

works_for_me
Volker Birk 2 years ago
parent
commit
cc4d4989a3
1 changed files with 19 additions and 19 deletions
  1. +19
    -19
      pEpMacOSAdapter/pEpMacOSAdapter.m

+ 19
- 19
pEpMacOSAdapter/pEpMacOSAdapter.m View File

@ -24,36 +24,36 @@ extern pEpUpdater* updater;
updater = [pEpUpdater new];
}
_clientConnection = [[NSXPCConnection alloc] initWithListenerEndpoint:endpoint];
_clientConnection.remoteObjectInterface = [NSXPCInterface
interfaceWithProtocol:@protocol(pEpNotificationProtocol)];
_clientConnection.interruptionHandler = ^(){NSLog(@"interruption"); updater.subscriber=nil;};
_clientConnection.invalidationHandler = ^(){NSLog(@"invalidation"); updater.subscriber=nil;};
[_clientConnection resume];
pEpNotification* downloadNotification = [_clientConnection remoteObjectProxyWithErrorHandler:^(NSError*err) {
NSLog(@"%@", err);
}];
updater.subscriber = downloadNotification;
if (downloadNotification) {
[downloadNotification notifyDownload:ready withName:@"" withFilename:@""];
if (updater) {
_clientConnection = [[NSXPCConnection alloc] initWithListenerEndpoint:endpoint];
_clientConnection.remoteObjectInterface = [NSXPCInterface
interfaceWithProtocol:@protocol(pEpNotificationProtocol)];
_clientConnection.interruptionHandler = ^(){NSLog(@"interruption"); updater.subscriber=nil;};
_clientConnection.invalidationHandler = ^(){NSLog(@"invalidation"); updater.subscriber=nil;};
[_clientConnection resume];
pEpNotification* downloadNotification = [_clientConnection remoteObjectProxyWithErrorHandler:^(NSError*err) {
NSLog(@"%@", err);
}];
updater.subscriber = downloadNotification;
if (downloadNotification) {
[downloadNotification notifyDownload:ready withName:@"" withFilename:@""];
}
}
}
- (void)unsubscribeForUpdate
{
NSLog(@"unsubscribeForUpdate called");
updater.subscriber = nil;
if (updater) updater.subscriber = nil;
}
- (void)updateNow
{
NSLog(@"updateNow called");
if (updater) {
[updater updateAll:nil];
}
if (updater) [updater updateAll:nil];
}
// end pEpMacOSAdapterProtocol


Loading…
Cancel
Save