mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:24:46 +02:00
prevent have more than one instance of a script after reloading script
This commit is contained in:
parent
4f561b00da
commit
8b4b95f890
1 changed files with 7 additions and 4 deletions
|
@ -432,10 +432,13 @@ bool ScriptEngines::stopScript(const QString& rawScriptURL, bool restart) {
|
||||||
ScriptEngine::Type type = scriptEngine->getType();
|
ScriptEngine::Type type = scriptEngine->getType();
|
||||||
auto scriptCache = DependencyManager::get<ScriptCache>();
|
auto scriptCache = DependencyManager::get<ScriptCache>();
|
||||||
scriptCache->deleteScript(scriptURL);
|
scriptCache->deleteScript(scriptURL);
|
||||||
connect(scriptEngine.data(), &ScriptEngine::finished,
|
|
||||||
this, [this, isUserLoaded, type](QString scriptName, ScriptEnginePointer engine) {
|
if (!scriptEngine->isStopping()) {
|
||||||
reloadScript(scriptName, isUserLoaded)->setType(type);
|
connect(scriptEngine.data(), &ScriptEngine::finished,
|
||||||
});
|
this, [this, isUserLoaded, type](QString scriptName, ScriptEnginePointer engine) {
|
||||||
|
reloadScript(scriptName, isUserLoaded)->setType(type);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
scriptEngine->stop();
|
scriptEngine->stop();
|
||||||
stoppedScript = true;
|
stoppedScript = true;
|
||||||
|
|
Loading…
Reference in a new issue