stop script engine when entity server goes away

This commit is contained in:
Stephen Birarda 2017-01-19 12:00:24 -08:00
parent 6c21339485
commit b00435074e

View file

@ -297,7 +297,11 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, const
void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) {
if (killedNode->getType() == NodeType::EntityServer) {
_entitiesScriptEngine->unloadAllEntityScripts();
if (_entitiesScriptEngine) {
_entitiesScriptEngine->unloadAllEntityScripts();
_entitiesScriptEngine->stop();
}
resetEntitiesScriptEngine();
}
}