mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-15 14:27:29 +00:00
Fixes -invalidate: cancel the dispatch source, don't just suspend it, and wait until that is done.
This commit is contained in:
@@ -31,7 +31,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)invalidate {
|
- (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
|
@end
|
||||||
|
Reference in New Issue
Block a user