Merge pull request #3779 from renewedvision-kh/master
Add autoreleasepool to DisplayLinkCallback to release objects
This commit is contained in:
commit
15f6675966
|
@ -269,6 +269,7 @@ static BOOL kSDDisplayLinkUseTargetTimestamp = NO; // Use `next` fire time, or `
|
||||||
|
|
||||||
#if SD_MAC
|
#if SD_MAC
|
||||||
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
|
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
|
||||||
|
@autoreleasepool {
|
||||||
// CVDisplayLink callback is not on main queue
|
// CVDisplayLink callback is not on main queue
|
||||||
// Actually `SDWeakProxy` but not `SDDisplayLink`
|
// Actually `SDWeakProxy` but not `SDDisplayLink`
|
||||||
SDDisplayLink *object = (__bridge SDDisplayLink *)displayLinkContext;
|
SDDisplayLink *object = (__bridge SDDisplayLink *)displayLinkContext;
|
||||||
|
@ -286,5 +287,6 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
||||||
[object displayLinkDidRefresh:(__bridge id)(displayLink)];
|
[object displayLinkDidRefresh:(__bridge id)(displayLink)];
|
||||||
});
|
});
|
||||||
return kCVReturnSuccess;
|
return kCVReturnSuccess;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue