Merge pull request #5960 from ZappoMan/fixScriptStopAgentCrash

fix possible crash in agent
This commit is contained in:
Ryan Huffman 2015-09-30 15:49:06 -07:00
commit 2dc0d68f0f

View file

@ -364,10 +364,14 @@ void Agent::processAgentAvatarAndAudio(float deltaTime) {
}
void Agent::aboutToFinish() {
_scriptEngine->stop();
if (_scriptEngine) {
_scriptEngine->stop();
}
_pingTimer->stop();
delete _pingTimer;
if (_pingTimer) {
_pingTimer->stop();
delete _pingTimer;
}
// our entity tree is going to go away so tell that to the EntityScriptingInterface
DependencyManager::get<EntityScriptingInterface>()->setEntityTree(NULL);