Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -775,6 +775,10 @@ void ScriptEngine::stopAllTimers() { · 774 unmodified lines | ||
| 775 | 775 | |
| 776 | 776 | void ScriptEngine::stop() { |
| 777 | 777 | if (!_isFinished) { |
| 778 | + if (QThread::currentThread() != thread()) { | |
| 779 | + QMetaObject::invokeMethod(this, "stop"); | |
| 780 | + return; | |
| 781 | + } | |
| 778 | 782 | _isFinished = true; |
| 779 | 783 | if (_wantSignals) { |
| 780 | 784 | emit runningStateChanged(); |