Move cleanup back to destructor
Reviewed By: javache Differential Revision: D5697611 fbshipit-source-id: e8bce63aec02d08421eea52b20343576e914e5aa
This commit is contained in:
parent
79fdb91bb7
commit
f266ab9bac
|
@ -329,7 +329,6 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
UiThreadUtil.runOnUiThread(new Runnable() {
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
quitQueuesSynchronous();
|
|
||||||
mHybridData.resetNative();
|
mHybridData.resetNative();
|
||||||
// Kill non-UI threads from UI thread.
|
// Kill non-UI threads from UI thread.
|
||||||
getReactQueueConfiguration().destroy();
|
getReactQueueConfiguration().destroy();
|
||||||
|
@ -343,8 +342,6 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
Systrace.unregisterListener(mTraceListener);
|
Systrace.unregisterListener(mTraceListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private native void quitQueuesSynchronous();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDestroyed() {
|
public boolean isDestroyed() {
|
||||||
return mDestroyed;
|
return mDestroyed;
|
||||||
|
|
|
@ -85,10 +85,9 @@ CatalystInstanceImpl::CatalystInstanceImpl()
|
||||||
: instance_(folly::make_unique<Instance>()) {}
|
: instance_(folly::make_unique<Instance>()) {}
|
||||||
|
|
||||||
CatalystInstanceImpl::~CatalystInstanceImpl() {
|
CatalystInstanceImpl::~CatalystInstanceImpl() {
|
||||||
}
|
if (moduleMessageQueue_ != NULL) {
|
||||||
|
|
||||||
void CatalystInstanceImpl::quitQueuesSynchronous() {
|
|
||||||
moduleMessageQueue_->quitSynchronous();
|
moduleMessageQueue_->quitSynchronous();
|
||||||
|
}
|
||||||
if (uiBackgroundMessageQueue_ != NULL) {
|
if (uiBackgroundMessageQueue_ != NULL) {
|
||||||
uiBackgroundMessageQueue_->quitSynchronous();
|
uiBackgroundMessageQueue_->quitSynchronous();
|
||||||
}
|
}
|
||||||
|
@ -98,7 +97,6 @@ void CatalystInstanceImpl::registerNatives() {
|
||||||
registerHybrid({
|
registerHybrid({
|
||||||
makeNativeMethod("initHybrid", CatalystInstanceImpl::initHybrid),
|
makeNativeMethod("initHybrid", CatalystInstanceImpl::initHybrid),
|
||||||
makeNativeMethod("initializeBridge", CatalystInstanceImpl::initializeBridge),
|
makeNativeMethod("initializeBridge", CatalystInstanceImpl::initializeBridge),
|
||||||
makeNativeMethod("quitQueuesSynchronous", CatalystInstanceImpl::quitQueuesSynchronous),
|
|
||||||
makeNativeMethod("jniExtendNativeModules", CatalystInstanceImpl::extendNativeModules),
|
makeNativeMethod("jniExtendNativeModules", CatalystInstanceImpl::extendNativeModules),
|
||||||
makeNativeMethod("jniSetSourceURL", CatalystInstanceImpl::jniSetSourceURL),
|
makeNativeMethod("jniSetSourceURL", CatalystInstanceImpl::jniSetSourceURL),
|
||||||
makeNativeMethod("jniLoadScriptFromAssets", CatalystInstanceImpl::jniLoadScriptFromAssets),
|
makeNativeMethod("jniLoadScriptFromAssets", CatalystInstanceImpl::jniLoadScriptFromAssets),
|
||||||
|
|
|
@ -35,8 +35,6 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
|
||||||
return instance_;
|
return instance_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void quitQueuesSynchronous();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend HybridBase;
|
friend HybridBase;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue