call script engine shutdown when assignment stopping

This commit is contained in:
Stephen Birarda 2017-01-19 16:59:33 -08:00
parent c5140ac695
commit 88ea6fa589
2 changed files with 5 additions and 2 deletions

View file

@ -254,7 +254,7 @@ void EntityScriptServer::clear() {
_entityViewer.clear(); _entityViewer.clear();
} }
void EntityScriptServer::shutdown() { void EntityScriptServer::shutdownScriptEngine() {
if (_entitiesScriptEngine) { if (_entitiesScriptEngine) {
_entitiesScriptEngine->disconnectNonEssentialSignals(); // disconnect all slots/signals from the script engine, except essential _entitiesScriptEngine->disconnectNonEssentialSignals(); // disconnect all slots/signals from the script engine, except essential
} }
@ -351,6 +351,8 @@ void EntityScriptServer::handleJurisdictionPacket(QSharedPointer<ReceivedMessage
} }
void EntityScriptServer::aboutToFinish() { void EntityScriptServer::aboutToFinish() {
shutdownScriptEngine();
// our entity tree is going to go away so tell that to the EntityScriptingInterface // our entity tree is going to go away so tell that to the EntityScriptingInterface
DependencyManager::get<EntityScriptingInterface>()->setEntityTree(nullptr); DependencyManager::get<EntityScriptingInterface>()->setEntityTree(nullptr);

View file

@ -48,7 +48,8 @@ private:
void resetEntitiesScriptEngine(); void resetEntitiesScriptEngine();
void clear(); void clear();
void shutdown(); void shutdownScriptEngine();
void addingEntity(const EntityItemID& entityID); void addingEntity(const EntityItemID& entityID);
void deletingEntity(const EntityItemID& entityID); void deletingEntity(const EntityItemID& entityID);
void entityServerScriptChanging(const EntityItemID& entityID, const bool reload); void entityServerScriptChanging(const EntityItemID& entityID, const bool reload);