From 8ea9a1bc94a0d5635f6ab286331a8acba912f15f 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 e619c67d7..50f6deb93 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -482,6 +482,7 @@ RCT_EXTERN NSArray *RCTGetModuleClasses(void); } _loading = NO; + [_javaScriptExecutor invalidate]; [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptDidFailToLoadNotification