History

trying to mimic previous behavior more closely

Seth Alves committed 10 years ago

Commit b0ce65e1 parent 04bd27e6 files · +29 −21Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+7−5
@@ -290,7 +290,7 @@ void ScriptEngine::waitTillDoneRunning() { · 289 unmodified lines
290290 assert(workerThread != QThread::currentThread());
291291
292292 // Engine should be stopped already, but be defensive
293− stop();
293+ stop(false);
294294
295295 auto startedWaiting = usecTimestampNow();
296296 while (workerThread->isRunning()) {
@@ -941,13 +941,15 @@ void ScriptEngine::stopAllTimersForEntityScript(const EntityItemID& entityID) { · 644 unmodified lines
941941
942942 }
943943
944−void ScriptEngine::stop() {
944+void ScriptEngine::stop(bool marshal) {
945945 _isStopping = true; // this can be done on any thread
946946
947947 // marshal us over to the correct thread
948− if (QThread::currentThread() != thread()) {
949− QMetaObject::invokeMethod(this, "stop");
950− return;
948+ if (marshal) {
949+ if (QThread::currentThread() != thread()) {
950+ QMetaObject::invokeMethod(this, "stop");
951+ return;
952+ }
951953 }
952954 if (!_isFinished) {
953955 _isFinished = true;