[ReactNative] Add tests on root view, bridge, modules and js context deallocation

This commit is contained in:
Tadeu Zagallo 2015-04-20 05:40:42 -07:00
parent 88b6df9900
commit 915925db9d
1 changed files with 6 additions and 7 deletions

View File

@ -47,10 +47,12 @@
- (void)invalidate - (void)invalidate
{ {
if (self.isValid) {
JSGlobalContextRelease(_ctx); JSGlobalContextRelease(_ctx);
_ctx = NULL; _ctx = NULL;
_self = nil; _self = nil;
} }
}
@end @end
@ -216,10 +218,7 @@ static NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError)
- (void)invalidate - (void)invalidate
{ {
if (self.isValid) {
[_context performSelector:@selector(invalidate) onThread:_javaScriptThread withObject:nil waitUntilDone:NO]; [_context performSelector:@selector(invalidate) onThread:_javaScriptThread withObject:nil waitUntilDone:NO];
_context = nil;
}
} }
- (void)dealloc - (void)dealloc