Fix multiple calls to createReactContextInBackground

Reviewed By: astreet

Differential Revision: D2674440

fb-gh-sync-id: f842826516d2b03291ad0c4bf5c8dcbf8ec0f3a9
This commit is contained in:
Mike Armstrong 2015-11-19 07:11:39 -08:00 committed by facebook-github-bot-9
parent 7da42e3950
commit 3e7db56445
1 changed files with 2 additions and 6 deletions

View File

@ -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());
}
}