From 40b3d7f4385b0825b456a90dd24c115679e33c23 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 29 Nov 2023 17:37:29 +0800 Subject: [PATCH] Remove the unused legacy code for weak retain --- SDWebImage/Private/SDDisplayLink.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SDWebImage/Private/SDDisplayLink.m b/SDWebImage/Private/SDDisplayLink.m index 43d9ffb8..0472a2f7 100644 --- a/SDWebImage/Private/SDDisplayLink.m +++ b/SDWebImage/Private/SDDisplayLink.m @@ -272,10 +272,10 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt return kCVReturnSuccess; } CVTimeStamp outputTime = inOutputTime ? *inOutputTime : *inNow; - __weak SDDisplayLink *weakObject = object; + // `SDWeakProxy` is weak, so it's safe to dispatch to main queue without leak dispatch_async(dispatch_get_main_queue(), ^{ - weakObject.outputTime = outputTime; - [weakObject displayLinkDidRefresh:(__bridge id)(displayLink)]; + object.outputTime = outputTime; + [object displayLinkDidRefresh:(__bridge id)(displayLink)]; }); return kCVReturnSuccess; }