Don't explicitly destroy ScriptEngine; move emit finished to logical location

When DependencyManager creates new ScriptEngine it will destroy old
one on correct thread.
Previous emit finished() location causes deferred delete of Agent
while still in use.
This commit is contained in:
Simon Walton 2018-07-09 13:38:56 -07:00
commit ac43c40d73
2 changed files with 2 additions and 2 deletions

View file

@ -497,6 +497,7 @@ void Agent::executeScript() {
DependencyManager::destroy<RecordingScriptingInterface>();
setFinished(true);
emit finished();
}
QUuid Agent::getSessionUUID() const {
@ -838,7 +839,6 @@ void Agent::aboutToFinish() {
// destroy all other created dependencies
DependencyManager::destroy<ScriptCache>();
DependencyManager::destroy<ScriptEngines>();
DependencyManager::destroy<ResourceCacheSharedItems>();
DependencyManager::destroy<SoundCache>();

View file

@ -67,7 +67,7 @@ void ThreadedAssignment::setFinished(bool isFinished) {
// call our virtual aboutToFinish method - this gives the ThreadedAssignment subclass a chance to cleanup
aboutToFinish();
emit finished();
//emit finished();
}
}
}