diff --git a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/CatalystInstanceImpl.java b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/CatalystInstanceImpl.java index 80be1fbe5..6133b2576 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/CatalystInstanceImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/CatalystInstanceImpl.java @@ -292,11 +292,11 @@ public class CatalystInstanceImpl implements CatalystInstance { // TODO: tell all APIs to shut down mDestroyed = true; - mHybridData.resetNative(); mReactQueueConfiguration.getNativeModulesQueueThread().runOnQueue(new Runnable() { @Override public void run() { mJavaRegistry.notifyJSInstanceDestroy(); + mHybridData.resetNative(); } }); boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0); diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.java index d00d14c38..540714b2f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.java @@ -171,7 +171,12 @@ public class EventDispatcher implements LifecycleEventListener { } public void onCatalystInstanceDestroyed() { - stopFrameCallback(); + UiThreadUtil.runOnUiThread(new Runnable() { + @Override + public void run() { + stopFrameCallback(); + } + }); } private void stopFrameCallback() {