Move cleanup back to destructor

Reviewed By: javache

Differential Revision: D5697611

fbshipit-source-id: e8bce63aec02d08421eea52b20343576e914e5aa
This commit is contained in:
Kathy Gray 2017-08-24 07:55:43 -07:00 committed by Facebook Github Bot
parent 79fdb91bb7
commit f266ab9bac
3 changed files with 3 additions and 10 deletions

View File

@ -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;

View File

@ -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),

View File

@ -35,8 +35,6 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
return instance_;
}
void quitQueuesSynchronous();
private:
friend HybridBase;