Merge pull request #4574 from ZappoMan/crashOnExit

fix crash on shutdown related to entity scripts connecting to signals
This commit is contained in:
Andrew Meadows 2015-04-01 17:26:33 -07:00
commit b537625e59
2 changed files with 4 additions and 0 deletions

View file

@ -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

View file

@ -107,6 +107,7 @@ void EntityTreeRenderer::init() {
}
void EntityTreeRenderer::shutdown() {
_entitiesScriptEngine->disconnect(); // disconnect all slots/signals from the script engine
_shuttingDown = true;
}