Move destroy threads in catalystinstance off the UI thread
Reviewed By: cwdick Differential Revision: D5842135 fbshipit-source-id: e9c44c4129d4d10da8781798df121f5c676766f8
This commit is contained in:
parent
2f78d19df2
commit
cf2ef84b16
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue