Skip to content

Commit

Permalink
Move destroy threads in catalystinstance off the UI thread
Browse files Browse the repository at this point in the history
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 cf2ef84
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit cf2ef84

Please sign in to comment.