Fix JS deallocation on load errors

Summary:Fixes #6281

The JS executor is invalidated from `[RCTBatchedBridger stopLoadingWithError:]`
which prevented another blocks that depended on the executor to run in the bridge
invalidation.

Reviewed By: javache

Differential Revision: D3018299

fb-gh-sync-id: 4f482b9b697bfabd24b405398d25c72b9e1a3c84
shipit-source-id: 4f482b9b697bfabd24b405398d25c72b9e1a3c84
This commit is contained in:
Tadeu Zagallo 2016-03-07 09:45:20 -08:00 committed by Facebook Github Bot 6
parent 006907bdaa
commit 24c458aa08
1 changed files with 5 additions and 5 deletions

View File

@ -388,6 +388,11 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
#if RCT_DEV
[[NSNotificationCenter defaultCenter] removeObserver:self];
#endif
}
- (void)dealloc
{
[self invalidate];
[_context performSelector:@selector(invalidate)
onThread:_javaScriptThread
@ -396,11 +401,6 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
_context = nil;
}
- (void)dealloc
{
[self invalidate];
}
- (void)flushedQueue:(RCTJavaScriptCallback)onComplete
{
// TODO: Make this function handle first class instead of dynamically dispatching it. #9317773