Permalink
Browse files

Move destroy threads in catalystinstance off the UI thread

Reviewed By: cwdick

Differential Revision: D5842135

fbshipit-source-id: e9c44c4129d4d10da8781798df121f5c676766f8
  • Loading branch information...
Kathy Gray authored and facebook-github-bot committed Sep 15, 2017
1 parent 2f78d19 commit cf2ef84b16775e0e0eb53410e7e6e4ac66d05d03
Showing with 5 additions and 2 deletions.
  1. +5 −2 ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java
@@ -10,7 +10,9 @@
package com.facebook.react.bridge;
import android.content.res.AssetManager;
import android.os.AsyncTask;
import android.util.Log;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.jni.HybridData;
@@ -326,11 +328,12 @@ public void run() {
listener.onTransitionToBridgeIdle();
}
}
UiThreadUtil.runOnUiThread(new Runnable() {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
// Kill non-UI threads from neutral third party
// potentially expensive, so don't run on UI thread
mHybridData.resetNative();
// Kill non-UI threads from UI thread.
getReactQueueConfiguration().destroy();
Log.d(ReactConstants.TAG, "CatalystInstanceImpl.destroy() end");
}

0 comments on commit cf2ef84

Please sign in to comment.