Skip to content

Commit

Permalink
Remove RCTUIImageViewAnimated WeakProxy gating
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mehdi Mulani authored and facebook-github-bot committed Aug 22, 2019
1 parent 947e71a commit 59f84ca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 0 additions & 2 deletions Libraries/Image/RCTUIImageViewAnimated.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#import <React/RCTAnimatedImage.h>
#import <React/RCTDefines.h>

RCT_EXTERN void RCTUIImageViewEnableWeakProxy(BOOL enabled);

@interface RCTUIImageViewAnimated : UIImageView

@end
9 changes: 1 addition & 8 deletions Libraries/Image/RCTUIImageViewAnimated.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#import <mach/mach.h>
#import <objc/runtime.h>

static BOOL weakProxyEnabled = YES;
void RCTUIImageViewEnableWeakProxy(BOOL enabled) {
weakProxyEnabled = enabled;
}

static NSUInteger RCTDeviceTotalMemory() {
return (NSUInteger)[[NSProcessInfo processInfo] physicalMemory];
}
Expand Down Expand Up @@ -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];
}
Expand Down

0 comments on commit 59f84ca

Please sign in to comment.