aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerobjectlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerobjectlist.cpp')
-rw-r--r--linden/indra/newview/llviewerobjectlist.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp
index 78ce247..2d6c9f4 100644
--- a/linden/indra/newview/llviewerobjectlist.cpp
+++ b/linden/indra/newview/llviewerobjectlist.cpp
@@ -166,12 +166,12 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
166 return (((U64)index) << 32) | (U64)local_id; 166 return (((U64)index) << 32) | (U64)local_id;
167} 167}
168 168
169BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) 169BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
170{ 170{
171 if(object.getRegion()) 171 if (objectp && objectp->getRegion())
172 { 172 {
173 U32 local_id = object.mLocalID; 173 U32 local_id = objectp->mLocalID;
174 LLHost region_host = object.getRegion()->getHost(); 174 LLHost region_host = objectp->getRegion()->getHost();
175 U32 ip = region_host.getAddress(); 175 U32 ip = region_host.getAddress();
176 U32 port = region_host.getPort(); 176 U32 port = region_host.getPort();
177 U64 ipport = (((U64)ip) << 32) | (U64)port; 177 U64 ipport = (((U64)ip) << 32) | (U64)port;
@@ -186,7 +186,7 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)
186 } 186 }
187 187
188 // Found existing entry 188 // Found existing entry
189 if (iter->second == object.getID()) 189 if (iter->second == objectp->getID())
190 { // Full UUIDs match, so remove the entry 190 { // Full UUIDs match, so remove the entry
191 sIndexAndLocalIDToUUID.erase(iter); 191 sIndexAndLocalIDToUUID.erase(iter);
192 return TRUE; 192 return TRUE;
@@ -451,7 +451,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
451 ((objectp->mLocalID != local_id) || 451 ((objectp->mLocalID != local_id) ||
452 (objectp->getRegion() != regionp))) 452 (objectp->getRegion() != regionp)))
453 { 453 {
454 removeFromLocalIDTable(*objectp); 454 removeFromLocalIDTable(objectp);
455 setUUIDAndLocal(fullid, 455 setUUIDAndLocal(fullid,
456 local_id, 456 local_id,
457 gMessageSystem->getSenderIP(), 457 gMessageSystem->getSenderIP(),
@@ -813,20 +813,26 @@ void LLViewerObjectList::clearDebugText()
813 813
814void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) 814void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
815{ 815{
816 if (!objectp)
817 {
818 llwarns << "NULL object pointer passed." << llendl;
819 return;
820 }
816 LLMemType mt(LLMemType::MTYPE_OBJECT); 821 LLMemType mt(LLMemType::MTYPE_OBJECT);
817 if (mDeadObjects.count(objectp->mID)) 822 if (mDeadObjects.find(objectp->mID) != mDeadObjects.end())
818 { 823 {
819 llinfos << "Object " << objectp->mID << " already on dead list, ignoring cleanup!" << llendl; 824 llinfos << "Object " << objectp->mID << " already on dead list, ignoring cleanup!" << llendl;
820 return;
821 } 825 }
822 826 else
823 mDeadObjects.insert(std::pair<LLUUID, LLPointer<LLViewerObject> >(objectp->mID, objectp)); 827 {
828 mDeadObjects.insert(objectp->mID);
829 }
824 830
825 // Cleanup any references we have to this object 831 // Cleanup any references we have to this object
826 // Remove from object map so noone can look it up. 832 // Remove from object map so noone can look it up.
827 833
828 mUUIDObjectMap.erase(objectp->mID); 834 mUUIDObjectMap.erase(objectp->mID);
829 removeFromLocalIDTable(*objectp); 835 removeFromLocalIDTable(objectp);
830 836
831 if (objectp->onActiveList()) 837 if (objectp->onActiveList())
832 { 838 {
@@ -1060,7 +1066,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
1060 for (S32 i = 0; i < mMapObjects.count(); i++) 1066 for (S32 i = 0; i < mMapObjects.count(); i++)
1061 { 1067 {
1062 LLViewerObject* objectp = mMapObjects[i]; 1068 LLViewerObject* objectp = mMapObjects[i];
1063 if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment()) 1069 if (objectp->isDead() || !objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment())
1064 { 1070 {
1065 continue; 1071 continue;
1066 } 1072 }