Skip to content

Commit

Permalink
Fix for the timing issue of termination detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
fujisoft committed Aug 8, 2017
1 parent 7c8ff2b commit 900de55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sparkle/Autoupdate/TerminationListener.m
Expand Up @@ -116,6 +116,11 @@ - (void)startListeningWithCompletion:(void (^)(BOOL))completionBlock
if ([self terminated]) {
[self invokeCompletionWithSuccess:YES];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if ([self terminated]) {
[self invokeCompletionWithSuccess:YES];
}
});
}

static void noteExitKQueueCallback(CFFileDescriptorRef file, CFOptionFlags __unused callBackTypes, void *info)
Expand Down

0 comments on commit 900de55

Please sign in to comment.