History

Update ScriptEngine::stop() to always run on its thread

Ryan Huffman committed 10 years ago

Commit a21e0731 parent e7a15501 file · +4 −0Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+4−0
@@ -775,6 +775,10 @@ void ScriptEngine::stopAllTimers() { · 774 unmodified lines
775775
776776 void ScriptEngine::stop() {
777777 if (!_isFinished) {
778+ if (QThread::currentThread() != thread()) {
779+ QMetaObject::invokeMethod(this, "stop");
780+ return;
781+ }
778782 _isFinished = true;
779783 if (_wantSignals) {
780784 emit runningStateChanged();