History

trying again -- frantic clicking on reload no longer appears to wedge things

Seth Alves committed 10 years ago

Commit 49769f71 parent 75329c86 files · +18 −27Browse 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+3−6
@@ -290,7 +290,7 @@ void ScriptEngine::waitTillDoneRunning() { · 289 unmodified lines
290 assert(workerThread != QThread::currentThread());290 assert(workerThread != QThread::currentThread());
291 291
292 // Engine should be stopped already, but be defensive292 // Engine should be stopped already, but be defensive
293 stop(false);293 stop();
294 294
295 auto startedWaiting = usecTimestampNow();295 auto startedWaiting = usecTimestampNow();
296 while (workerThread->isRunning()) {296 while (workerThread->isRunning()) {
@@ -944,12 +944,9 @@ void ScriptEngine::stopAllTimersForEntityScript(const EntityItemID& entityID) { · 647 unmodified lines
944void ScriptEngine::stop(bool marshal) {944void ScriptEngine::stop(bool marshal) {
945 _isStopping = true; // this can be done on any thread945 _isStopping = true; // this can be done on any thread
946 946
947 // marshal us over to the correct thread
948 if (marshal) {947 if (marshal) {
949 if (QThread::currentThread() != thread()) {948 QMetaObject::invokeMethod(this, "stop");
950 QMetaObject::invokeMethod(this, "stop");949 return;
951 return;
952 }
953 }950 }
954 if (!_isFinished) {951 if (!_isFinished) {
955 _isFinished = true;952 _isFinished = true;