From 3e7db5644514c144f78c5e71d4f8a6d825fd4cd1 Mon Sep 17 00:00:00 2001 From: Mike Armstrong Date: Thu, 19 Nov 2015 07:11:39 -0800 Subject: [PATCH] Fix multiple calls to createReactContextInBackground Reviewed By: astreet Differential Revision: D2674440 fb-gh-sync-id: f842826516d2b03291ad0c4bf5c8dcbf8ec0f3a9 --- .../java/com/facebook/react/ReactInstanceManager.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 4678fd9f4..b8cf21b23 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -438,12 +438,8 @@ public class ReactInstanceManager { // If react context is being created in the background, JS application will be started // automatically when creation completes, as root view is part of the attached root view list. - if (!mIsContextInitAsyncTaskRunning) { - if (mCurrentReactContext == null) { - createReactContextInBackground(); - } else { - attachMeasuredRootViewToInstance(rootView, mCurrentReactContext.getCatalystInstance()); - } + if (!mIsContextInitAsyncTaskRunning && mCurrentReactContext != null) { + attachMeasuredRootViewToInstance(rootView, mCurrentReactContext.getCatalystInstance()); } }