History

stop script engine when entity server goes away

Stephen Birarda committed 9 years ago

Commit b0043501 parent 6c213391 file · +5 −1Browse files

Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 1 file). Show all

Unified · Split

assignment-client/src/scripts/EntityScriptServer.cpp+5−1
@@ -297,7 +297,11 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, const · 296 unmodified lines
297297
298298 void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) {
299299 if (killedNode->getType() == NodeType::EntityServer) {
300− _entitiesScriptEngine->unloadAllEntityScripts();
300+ if (_entitiesScriptEngine) {
301+ _entitiesScriptEngine->unloadAllEntityScripts();
302+ _entitiesScriptEngine->stop();
303+ }
304+
301305 resetEntitiesScriptEngine();
302306 }
303307 }