Skip to content

Commit

Permalink
Merge pull request #1116 from fujisoft/patch-3
Browse files Browse the repository at this point in the history
Workaround for timing issue of termination detection.

Not sure if that is correct.
  • Loading branch information
kornelski committed Aug 11, 2017
2 parents 7c8ff2b + 900de55 commit 65b12a2
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 65b12a2

Please sign in to comment.