From 59f84ca1fd4a5700d67cc7c68194dd845a1ecfd6 Mon Sep 17 00:00:00 2001 From: Mehdi Mulani Date: Thu, 22 Aug 2019 10:14:58 -0700 Subject: [PATCH] Remove RCTUIImageViewAnimated WeakProxy gating Summary: To help determine how severe this issue is, put the fix behind a MC. We will only pick the parent diff to the RC branch so that the fix immediately goes to master and we don't have to worry about fixing this any further. Reviewed By: fkgozali Differential Revision: D16940181 fbshipit-source-id: 91eb08181f82f51aea6a20b3fd489a33bdc0e424 --- Libraries/Image/RCTUIImageViewAnimated.h | 2 -- Libraries/Image/RCTUIImageViewAnimated.m | 9 +-------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Libraries/Image/RCTUIImageViewAnimated.h b/Libraries/Image/RCTUIImageViewAnimated.h index 8b19147b2480ec..1c894a849d148a 100644 --- a/Libraries/Image/RCTUIImageViewAnimated.h +++ b/Libraries/Image/RCTUIImageViewAnimated.h @@ -8,8 +8,6 @@ #import #import -RCT_EXTERN void RCTUIImageViewEnableWeakProxy(BOOL enabled); - @interface RCTUIImageViewAnimated : UIImageView @end diff --git a/Libraries/Image/RCTUIImageViewAnimated.m b/Libraries/Image/RCTUIImageViewAnimated.m index f5c17d7e3e970e..01aa75f391c239 100644 --- a/Libraries/Image/RCTUIImageViewAnimated.m +++ b/Libraries/Image/RCTUIImageViewAnimated.m @@ -11,11 +11,6 @@ #import #import -static BOOL weakProxyEnabled = YES; -void RCTUIImageViewEnableWeakProxy(BOOL enabled) { - weakProxyEnabled = enabled; -} - static NSUInteger RCTDeviceTotalMemory() { return (NSUInteger)[[NSProcessInfo processInfo] physicalMemory]; } @@ -152,9 +147,7 @@ - (NSOperationQueue *)fetchQueue - (CADisplayLink *)displayLink { if (!_displayLink) { - __weak typeof(self) weakSelf = self; - id target = weakProxyEnabled ? [RCTWeakProxy weakProxyWithTarget:self] : weakSelf; - _displayLink = [CADisplayLink displayLinkWithTarget:target selector:@selector(displayDidRefresh:)]; + _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:@selector(displayDidRefresh:)]; NSString *runLoopMode = [NSProcessInfo processInfo].activeProcessorCount > 1 ? NSRunLoopCommonModes : NSDefaultRunLoopMode; [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:runLoopMode]; }