mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +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);
|
||||
|
||||
// Gracefully stop the engine's scripting thread
|
||||
scriptEngine->setIsStopping();
|
||||
scriptEngine->stop();
|
||||
|
||||
// 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();
|
||||
QMetaObject::invokeMethod(it.value(), "stop");
|
||||
//it.value()->stop();
|
||||
qCDebug(scriptengine) << "stopping script..." << it.key();
|
||||
}
|
||||
}
|
||||
|
@ -370,13 +370,13 @@ bool ScriptEngines::stopScript(const QString& rawScriptURL, bool restart) {
|
|||
if (_scriptEnginesHash.contains(scriptURL)) {
|
||||
ScriptEngine* scriptEngine = _scriptEnginesHash[scriptURL];
|
||||
if (restart) {
|
||||
scriptEngine->setIsStopping();
|
||||
auto scriptCache = DependencyManager::get<ScriptCache>();
|
||||
scriptCache->deleteScript(scriptURL);
|
||||
connect(scriptEngine, &ScriptEngine::finished, this, [this](QString scriptName, ScriptEngine* engine) {
|
||||
reloadScript(scriptName);
|
||||
});
|
||||
}
|
||||
scriptEngine->setIsStopping();
|
||||
scriptEngine->stop();
|
||||
stoppedScript = true;
|
||||
qCDebug(scriptengine) << "stopping script..." << scriptURL;
|
||||
|
|
Loading…
Reference in a new issue