1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-02 20:30:00 +00:00

Fixed: of course I can't rely on the pointer to CVTimeStamp not becoming dangling during a queue jump.

This commit is contained in:
Thomas Harte 2016-03-19 23:02:42 -04:00
parent 4c5d66c317
commit eabc382540

View File

@ -55,8 +55,9 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
const uint32_t activityMask = 0x01;
if(!OSAtomicTestAndSet(activityMask, &_updateIsOngoing))
{
CVTimeStamp time = *now;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
[self.delegate openGLView:self didUpdateToTime:*now];
[self.delegate openGLView:self didUpdateToTime:time];
[self drawViewOnlyIfDirty:YES];
OSAtomicTestAndClear(activityMask, &_updateIsOngoing);
});