diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 9d094e3e55..88dd547eea 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -567,6 +567,9 @@ void Application::aboutToQuit() { } void Application::cleanupBeforeQuit() { + + _entities.clear(); // this will allow entity scripts to properly shutdown + _datagramProcessor->shutdown(); // tell the datagram processor we're shutting down, so it can short circuit _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts ScriptEngine::stopAllScripts(this); // stop all currently running global scripts diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 95ca30a90f..5c35a9c256 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -107,6 +107,7 @@ void EntityTreeRenderer::init() { } void EntityTreeRenderer::shutdown() { + _entitiesScriptEngine->disconnect(); // disconnect all slots/signals from the script engine _shuttingDown = true; }