mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Fixes -invalidate: cancel the dispatch source, don't just suspend it, and wait until that is done.
This commit is contained in:
parent
0310f94f0c
commit
256f4a6679
@ -31,7 +31,15 @@
|
||||
}
|
||||
|
||||
- (void)invalidate {
|
||||
dispatch_suspend(_timer);
|
||||
NSConditionLock *lock = [[NSConditionLock alloc] initWithCondition:0];
|
||||
|
||||
dispatch_source_set_cancel_handler(_timer, ^{
|
||||
[lock lock];
|
||||
[lock unlockWithCondition:1];
|
||||
});
|
||||
|
||||
dispatch_source_cancel(_timer);
|
||||
[lock lockWhenCondition:1];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user