Merge pull request #20 from birarda/entity-script-server

call script engine shutdown when assignment stopping
This commit is contained in:
Clément Brisset 2017-01-19 17:02:09 -08:00 committed by GitHub
commit 1f04bbee0a
2 changed files with 5 additions and 2 deletions

View file

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

View file

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