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() {
|
||||
@Override
|
||||
public void run() {
|
||||
quitQueuesSynchronous();
|
||||
mHybridData.resetNative();
|
||||
// Kill non-UI threads from UI thread.
|
||||
getReactQueueConfiguration().destroy();
|
||||
|
@ -343,8 +342,6 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
|||
Systrace.unregisterListener(mTraceListener);
|
||||
}
|
||||
|
||||
private native void quitQueuesSynchronous();
|
||||
|
||||
@Override
|
||||
public boolean isDestroyed() {
|
||||
return mDestroyed;
|
||||
|
|
|
@ -85,10 +85,9 @@ CatalystInstanceImpl::CatalystInstanceImpl()
|
|||
: instance_(folly::make_unique<Instance>()) {}
|
||||
|
||||
CatalystInstanceImpl::~CatalystInstanceImpl() {
|
||||
}
|
||||
|
||||
void CatalystInstanceImpl::quitQueuesSynchronous() {
|
||||
moduleMessageQueue_->quitSynchronous();
|
||||
if (moduleMessageQueue_ != NULL) {
|
||||
moduleMessageQueue_->quitSynchronous();
|
||||
}
|
||||
if (uiBackgroundMessageQueue_ != NULL) {
|
||||
uiBackgroundMessageQueue_->quitSynchronous();
|
||||
}
|
||||
|
@ -98,7 +97,6 @@ void CatalystInstanceImpl::registerNatives() {
|
|||
registerHybrid({
|
||||
makeNativeMethod("initHybrid", CatalystInstanceImpl::initHybrid),
|
||||
makeNativeMethod("initializeBridge", CatalystInstanceImpl::initializeBridge),
|
||||
makeNativeMethod("quitQueuesSynchronous", CatalystInstanceImpl::quitQueuesSynchronous),
|
||||
makeNativeMethod("jniExtendNativeModules", CatalystInstanceImpl::extendNativeModules),
|
||||
makeNativeMethod("jniSetSourceURL", CatalystInstanceImpl::jniSetSourceURL),
|
||||
makeNativeMethod("jniLoadScriptFromAssets", CatalystInstanceImpl::jniLoadScriptFromAssets),
|
||||
|
|
|
@ -35,8 +35,6 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
|
|||
return instance_;
|
||||
}
|
||||
|
||||
void quitQueuesSynchronous();
|
||||
|
||||
private:
|
||||
friend HybridBase;
|
||||
|
||||
|
|
Loading…
Reference in New Issue