Add autoreleasepool to DisplayLinkCallback to release objects

This commit is contained in:
Kevin Hardman 2025-01-03 13:37:04 -05:00
parent 10d06f6a33
commit 73c7e267a9
1 changed files with 17 additions and 15 deletions

View File

@ -269,6 +269,7 @@ static BOOL kSDDisplayLinkUseTargetTimestamp = NO; // Use `next` fire time, or `
#if SD_MAC
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
// Actually `SDWeakProxy` but not `SDDisplayLink`
SDDisplayLink *object = (__bridge SDDisplayLink *)displayLinkContext;
@ -287,4 +288,5 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
});
return kCVReturnSuccess;
}
}
#endif