aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorArmin Weatherwax2010-08-27 15:30:58 +0200
committerMcCabe Maxsted2010-08-29 01:31:22 -0700
commitde1f64910b86bd8c690868f645053509371b89cf (patch)
tree755f2e92d4f2455ddd25bad6ad0c555dbd2c57a6 /linden
parentgive the buttons in the windlight floaters love (diff)
downloadmeta-impy-de1f64910b86bd8c690868f645053509371b89cf.zip
meta-impy-de1f64910b86bd8c690868f645053509371b89cf.tar.gz
meta-impy-de1f64910b86bd8c690868f645053509371b89cf.tar.bz2
meta-impy-de1f64910b86bd8c690868f645053509371b89cf.tar.xz
fix possible crash caused by hudmanager
thanks to nemurimasu for the catch
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/llhudeffectlookat.cpp10
-rw-r--r--linden/indra/newview/llhudmanager.cpp3
2 files changed, 7 insertions, 6 deletions
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)
280 LLViewerObject* source_object = (LLViewerObject*)mSourceObject; 280 LLViewerObject* source_object = (LLViewerObject*)mSourceObject;
281 LLVOAvatar* source_avatar = NULL; 281 LLVOAvatar* source_avatar = NULL;
282 282
283 if (!source_object) 283 if (!source_object)//imprudence TODO: find out why this happens at all and fix there
284 { 284 {
285 LL_DEBUGS("HUDEffect")<<"NULL-Object HUDEffectLookAt message" << LL_ENDL;
285 markDead(); 286 markDead();
286 return; 287 return;
287 } 288 }
288 if (source_object->isAvatar()) //strange enough that non-objects try 289 if (source_object->isAvatar())
289 //to send a lookat message ...
290 { 290 {
291 source_avatar = (LLVOAvatar*)source_object; 291 source_avatar = (LLVOAvatar*)source_object;
292 } 292 }
293 else //... more strange if its an non-avatar object ... 293 else //imprudence TODO: find out why this happens at all and fix there
294 { 294 {
295 LL_DEBUGS("HUDEffect")<<"Non-Avatar HUDEffectLookAt message for ID: " << source_object->getID().asString()<< LL_ENDL; 295 LL_DEBUGS("HUDEffect")<<"Non-Avatar HUDEffectLookAt message for ID: " << source_object->getID().asString()<< LL_ENDL;
296 markDead(); 296 markDead();
@@ -300,7 +300,7 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys)
300 300
301 bool is_self = source_avatar->isSelf(); 301 bool is_self = source_avatar->isSelf();
302 bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); 302 bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget");
303 if (!is_self) //... very strange if it is not self. But happens. Also at local opensim. 303 if (!is_self) //imprudence TODO: find out why this happens at all and fix there
304 { 304 {
305 LL_DEBUGS("HUDEffect")<< "Non-self Avatar HUDEffectLookAt message for ID: " << source_avatar->getID().asString() << LL_ENDL; 305 LL_DEBUGS("HUDEffect")<< "Non-self Avatar HUDEffectLookAt message for ID: " << source_avatar->getID().asString() << LL_ENDL;
306 markDead(); 306 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()
103 msg->nextBlockFast(_PREHASH_Effect); 103 msg->nextBlockFast(_PREHASH_Effect);
104 hep->packData(msg); 104 hep->packData(msg);
105 hep->setNeedsSendToSim(FALSE); 105 hep->setNeedsSendToSim(FALSE);
106 gAgent.sendMessage(); 106 if (!hep->isDead()) //packData(msg) might have invalidated the effect
107 gAgent.sendMessage();
107 } 108 }
108 } 109 }
109} 110}