From 811cef198649be18768ca56c6eb61ebc19b4e283 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 19 Jan 2016 14:34:22 -0800 Subject: [PATCH] Invalidate JS executor when loading fails Summary: This solves https://github.com/facebook/react-native/issues/5090. Since https://github.com/facebook/react-native/commit/5b4e873c68be9a788ac8cc3f67199fbaacb58921 we had better reporting for when calls from native to JS fail. When trying to load an invalid bundle, this would now cause a stackoverflow, since RCTFatal would schedule a JS call to log, which would RCTFatal, which would ... By invalidating the jsExecutor immediately after loading fails, we prevent any more attempts to log. We can't invalidate the whole bridge at this point since we still need the redbox module to actually display the error. public Reviewed By: majak Differential Revision: D2834251 fb-gh-sync-id: a3e2ad425e40560beae4d3eacb93f66ace5341bf --- React/Base/RCTBatchedBridge.m | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index e619c67d74944b..50f6deb935fdd7 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -482,6 +482,7 @@ - (void)stopLoadingWithError:(NSError *)error } _loading = NO; + [_javaScriptExecutor invalidate]; [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptDidFailToLoadNotification