mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
set isStopping on other calls to stop
This commit is contained in:
parent
9ad488ba7b
commit
3f5ed4bef8
1 changed files with 2 additions and 2 deletions
|
@ -160,6 +160,7 @@ void ScriptEngines::shutdownScripting() {
|
||||||
scriptEngine->disconnect(this);
|
scriptEngine->disconnect(this);
|
||||||
|
|
||||||
// Gracefully stop the engine's scripting thread
|
// Gracefully stop the engine's scripting thread
|
||||||
|
scriptEngine->setIsStopping();
|
||||||
scriptEngine->stop();
|
scriptEngine->stop();
|
||||||
|
|
||||||
// We need to wait for the engine to be done running before we proceed, because we don't
|
// We need to wait for the engine to be done running before we proceed, because we don't
|
||||||
|
@ -353,7 +354,6 @@ void ScriptEngines::stopAllScripts(bool restart) {
|
||||||
}
|
}
|
||||||
it.value()->setIsStopping();
|
it.value()->setIsStopping();
|
||||||
QMetaObject::invokeMethod(it.value(), "stop");
|
QMetaObject::invokeMethod(it.value(), "stop");
|
||||||
//it.value()->stop();
|
|
||||||
qCDebug(scriptengine) << "stopping script..." << it.key();
|
qCDebug(scriptengine) << "stopping script..." << it.key();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,13 +370,13 @@ bool ScriptEngines::stopScript(const QString& rawScriptURL, bool restart) {
|
||||||
if (_scriptEnginesHash.contains(scriptURL)) {
|
if (_scriptEnginesHash.contains(scriptURL)) {
|
||||||
ScriptEngine* scriptEngine = _scriptEnginesHash[scriptURL];
|
ScriptEngine* scriptEngine = _scriptEnginesHash[scriptURL];
|
||||||
if (restart) {
|
if (restart) {
|
||||||
scriptEngine->setIsStopping();
|
|
||||||
auto scriptCache = DependencyManager::get<ScriptCache>();
|
auto scriptCache = DependencyManager::get<ScriptCache>();
|
||||||
scriptCache->deleteScript(scriptURL);
|
scriptCache->deleteScript(scriptURL);
|
||||||
connect(scriptEngine, &ScriptEngine::finished, this, [this](QString scriptName, ScriptEngine* engine) {
|
connect(scriptEngine, &ScriptEngine::finished, this, [this](QString scriptName, ScriptEngine* engine) {
|
||||||
reloadScript(scriptName);
|
reloadScript(scriptName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
scriptEngine->setIsStopping();
|
||||||
scriptEngine->stop();
|
scriptEngine->stop();
|
||||||
stoppedScript = true;
|
stoppedScript = true;
|
||||||
qCDebug(scriptengine) << "stopping script..." << scriptURL;
|
qCDebug(scriptengine) << "stopping script..." << scriptURL;
|
||||||
|
|
Loading…
Reference in a new issue