Move destroy threads in catalystinstance off the UI thread

Reviewed By: cwdick

Differential Revision: D5842135

fbshipit-source-id: e9c44c4129d4d10da8781798df121f5c676766f8
This commit is contained in:
Kathy Gray 2017-09-15 05:39:29 -07:00 committed by Facebook Github Bot
parent 2f78d19df2
commit cf2ef84b16
1 changed files with 5 additions and 2 deletions

View File

@ -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 class CatalystInstanceImpl implements CatalystInstance {
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");
}