History

Fixed crash with asset scripting crash

ksuprynowicz committed 3 years ago

Commit 6c1fd881 parent ca577f23 files · +11 −7Browse files

Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 3 files). Show all

Unified · Split

libraries/script-engine/src/ScriptManager.cpp+4−4
@@ -394,6 +394,7 @@ void ScriptManager::runInThread() { · 393 unmodified lines
394394 workerThread->setObjectName(name);
395395 _engine->setThread(workerThread);
396396 moveToThread(workerThread);
397+ _assetScriptingInterface->moveToThread(workerThread);
397398
398399 // NOTE: If you connect any essential signals for proper shutdown or cleanup of
399400 // the script engine, make sure to add code to "reconnect" them to the
@@ -884,10 +885,9 @@ void ScriptManager::run() { · 484 unmodified lines
884885 hifi::scripting::setLocalAccessSafeThread(true);
885886 }
886887
887−
888− //_engine->enterIsolateOnThisThread();
889−
890− _engine->compileTest();
888+ if (QThread::currentThread() != _assetScriptingInterface->thread()) {
889+ _assetScriptingInterface->moveToThread(QThread::currentThread());
890+ }
891891
892892 auto filenameParts = _fileNameString.split("/");
893893 auto name = filenameParts.size() > 0 ? filenameParts[filenameParts.size() - 1] : "unknown";