kill bridge only after cleaning up NativeModules
Reviewed By: javache Differential Revision: D4734634 fbshipit-source-id: c2d425485679454397d18b1a0c389714c0e3c484
This commit is contained in:
parent
cbd46aaa7c
commit
5328d952a8
|
@ -292,11 +292,11 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
|
|
||||||
// TODO: tell all APIs to shut down
|
// TODO: tell all APIs to shut down
|
||||||
mDestroyed = true;
|
mDestroyed = true;
|
||||||
mHybridData.resetNative();
|
|
||||||
mReactQueueConfiguration.getNativeModulesQueueThread().runOnQueue(new Runnable() {
|
mReactQueueConfiguration.getNativeModulesQueueThread().runOnQueue(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mJavaRegistry.notifyJSInstanceDestroy();
|
mJavaRegistry.notifyJSInstanceDestroy();
|
||||||
|
mHybridData.resetNative();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
|
boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
|
||||||
|
|
|
@ -171,7 +171,12 @@ public class EventDispatcher implements LifecycleEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCatalystInstanceDestroyed() {
|
public void onCatalystInstanceDestroyed() {
|
||||||
stopFrameCallback();
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
stopFrameCallback();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopFrameCallback() {
|
private void stopFrameCallback() {
|
||||||
|
|
Loading…
Reference in New Issue