History

code review

Seth Alves committed 10 years ago

Commit aa58cad1 parent 3f5ed4b3 files · +11 −5Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+7−0
@@ -938,6 +938,13 @@ void ScriptEngine::stopAllTimersForEntityScript(const EntityItemID& entityID) { · 937 unmodified lines
938938 }
939939
940940 void ScriptEngine::stop() {
941+ _isStopping = true; // this can be done on any thread
942+
943+ // marshal us over to the correct thread
944+ if (QThread::currentThread() != thread()) {
945+ QMetaObject::invokeMethod(this, "stop");
946+ return;
947+ }
941948 if (!_isFinished) {
942949 _isFinished = true;
943950 emit runningStateChanged();