From de1f64910b86bd8c690868f645053509371b89cf Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 27 Aug 2010 15:30:58 +0200 Subject: fix possible crash caused by hudmanager thanks to nemurimasu for the catch --- linden/indra/newview/llhudeffectlookat.cpp | 10 +++++----- linden/indra/newview/llhudmanager.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 561fce5..58d2c6a 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp @@ -280,17 +280,17 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) LLViewerObject* source_object = (LLViewerObject*)mSourceObject; LLVOAvatar* source_avatar = NULL; - if (!source_object) + if (!source_object)//imprudence TODO: find out why this happens at all and fix there { + LL_DEBUGS("HUDEffect")<<"NULL-Object HUDEffectLookAt message" << LL_ENDL; markDead(); return; } - if (source_object->isAvatar()) //strange enough that non-objects try - //to send a lookat message ... + if (source_object->isAvatar()) { source_avatar = (LLVOAvatar*)source_object; } - else //... more strange if its an non-avatar object ... + else //imprudence TODO: find out why this happens at all and fix there { LL_DEBUGS("HUDEffect")<<"Non-Avatar HUDEffectLookAt message for ID: " << source_object->getID().asString()<< LL_ENDL; markDead(); @@ -300,7 +300,7 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) bool is_self = source_avatar->isSelf(); bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); - if (!is_self) //... very strange if it is not self. But happens. Also at local opensim. + if (!is_self) //imprudence TODO: find out why this happens at all and fix there { LL_DEBUGS("HUDEffect")<< "Non-self Avatar HUDEffectLookAt message for ID: " << source_avatar->getID().asString() << LL_ENDL; markDead(); diff --git a/linden/indra/newview/llhudmanager.cpp b/linden/indra/newview/llhudmanager.cpp index 955d786..602ef6c 100644 --- a/linden/indra/newview/llhudmanager.cpp +++ b/linden/indra/newview/llhudmanager.cpp @@ -103,7 +103,8 @@ void LLHUDManager::sendEffects() msg->nextBlockFast(_PREHASH_Effect); hep->packData(msg); hep->setNeedsSendToSim(FALSE); - gAgent.sendMessage(); + if (!hep->isDead()) //packData(msg) might have invalidated the effect + gAgent.sendMessage(); } } } -- cgit v1.1