From d67044f220d47791a5ff18d6caa04356b942ea53 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 14 Mar 2018 13:32:48 -0700 Subject: [PATCH] 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/ --- assignment-client/src/scripts/EntityScriptServer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/assignment-client/src/scripts/EntityScriptServer.cpp b/assignment-client/src/scripts/EntityScriptServer.cpp index 60cb1e349b..8276807be7 100644 --- a/assignment-client/src/scripts/EntityScriptServer.cpp +++ b/assignment-client/src/scripts/EntityScriptServer.cpp @@ -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();