Explicitly exit the commit window tool

We were relying on the run loop to wake up as part of running a delayed selector, but that did not happen prior to 10.9.
This commit is contained in:
Allan Odgaard
2014-04-16 22:26:18 +07:00
parent 4474419405
commit bbfad640f5

View File

@@ -38,9 +38,18 @@ static size_t const AppRevision = APP_REVISION;
_returnCode = [someOptions[kOakCommitWindowReturnCode] intValue];
// Tear down the connection in next event loop iteration.
// This should allow the sender to get a reply.
// Tear down the connection in next run loop iteration.
// This should make us run long enough to allow the sender to get a reply.
[self performSelector:@selector(setConnection:) withObject:nil afterDelay:0];
// Prior to 10.9 the above does not cause runMode:beforeDate: to return,
// so for the benefit of 10.7 and 10.8 users, we explicitly call exit()
[self performSelector:@selector(terminate:) withObject:nil afterDelay:0];
}
- (void)terminate:(id)sender
{
exit(self.returnCode);
}
@end