[ReactNative] Create private underlying bridge to prevent retain cycles

This commit is contained in:
Tadeu Zagallo
2015-05-04 10:35:49 -07:00
parent b532ec000f
commit 132a9170f1
12 changed files with 522 additions and 349 deletions

View File

@@ -70,6 +70,7 @@
}
@synthesize bridge = _bridge;
@synthesize paused = _paused;
RCT_EXPORT_MODULE()
@@ -78,7 +79,7 @@ RCT_IMPORT_METHOD(RCTJSTimers, callTimers)
- (instancetype)init
{
if ((self = [super init])) {
_paused = YES;
_timers = [[RCTSparseArray alloc] init];
for (NSString *name in @[UIApplicationWillResignActiveNotification,
@@ -126,7 +127,7 @@ RCT_IMPORT_METHOD(RCTJSTimers, callTimers)
- (void)stopTimers
{
[_bridge removeFrameUpdateObserver:self];
_paused = YES;
}
- (void)startTimers
@@ -135,7 +136,7 @@ RCT_IMPORT_METHOD(RCTJSTimers, callTimers)
return;
}
[_bridge addFrameUpdateObserver:self];
_paused = NO;
}
- (void)didUpdateFrame:(RCTFrameUpdate *)update