Support null messageQueueThread in JSCExecutor

Reviewed By: michalgr

Differential Revision: D4119253

fbshipit-source-id: 2956434451bf4e649cfe4c0ee0a9b7339a5422a3
This commit is contained in:
Pieter De Baets 2016-11-02 14:24:42 -07:00 committed by Facebook Github Bot
parent 8e81644f64
commit 96cf9bb0c0
1 changed files with 6 additions and 2 deletions

View File

@ -201,9 +201,13 @@ JSCExecutor::~JSCExecutor() {
void JSCExecutor::destroy() {
*m_isDestroyed = true;
m_messageQueueThread->runOnQueueSync([this] () {
if (m_messageQueueThread.get()) {
m_messageQueueThread->runOnQueueSync([this] () {
terminateOnJSVMThread();
});
} else {
terminateOnJSVMThread();
});
}
}
void JSCExecutor::setContextName(const std::string& name) {