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