Skip to content

Commit

Permalink
Fix JS deallocation on load errors
Browse files Browse the repository at this point in the history
Summary:Fixes facebook#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
  • Loading branch information
tadeuzagallo authored and Facebook Github Bot 6 committed Mar 7, 2016
1 parent 006907b commit 24c458a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions React/Executors/RCTJSCExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ - (void)invalidate
#if RCT_DEV
[[NSNotificationCenter defaultCenter] removeObserver:self];
#endif
}

- (void)dealloc
{
[self invalidate];

[_context performSelector:@selector(invalidate)
onThread:_javaScriptThread
Expand All @@ -396,11 +401,6 @@ - (void)invalidate
_context = nil;
}

- (void)dealloc
{
[self invalidate];
}

- (void)flushedQueue:(RCTJavaScriptCallback)onComplete
{
// TODO: Make this function handle first class instead of dynamically dispatching it. #9317773
Expand Down

0 comments on commit 24c458a

Please sign in to comment.