mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
fix crash on shutdown
This commit is contained in:
parent
4ec1d304e0
commit
aac824fb99
2 changed files with 7 additions and 0 deletions
|
@ -566,6 +566,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
|
||||
|
|
|
@ -969,6 +969,10 @@ void EntityTreeRenderer::checkAndCallUnload(const EntityItemID& entityID) {
|
|||
QScriptValueList entityArgs = createEntityArgs(entityID);
|
||||
entityScript.property("unload").call(entityScript, entityArgs);
|
||||
}
|
||||
|
||||
// In the event that the entity script connected to any of our signals
|
||||
// we want to disconnect it so we don't have anything dangling
|
||||
_entitiesScriptEngine->disconnect(entityScript.toQObject());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue