EntityScriptServer should wait for script engine to finish when stopping

Script engine will still running and using EntityEditPacketSender,
which is owned by EntityScriptServer, which was destroyed.
https://highfidelity.manuscript.com/f/cases/11071/
This commit is contained in:
Simon Walton 2018-03-14 13:32:48 -07:00
parent db2b79f4fb
commit d67044f220

View file

@ -476,6 +476,7 @@ void EntityScriptServer::clear() {
// do this here (instead of in deleter) to avoid marshalling unload signals back to this thread
_entitiesScriptEngine->unloadAllEntityScripts();
_entitiesScriptEngine->stop();
_entitiesScriptEngine->waitTillDoneRunning();
}
_entityViewer.clear();