diff options
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llviewerobjectlist.cpp | 30 | ||||
-rw-r--r-- | linden/indra/newview/llviewerobjectlist.h | 5 | ||||
-rw-r--r-- | linden/indra/newview/llvocache.cpp | 5 |
3 files changed, 24 insertions, 16 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 | ||
169 | BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) | 169 | BOOL 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 | ||
814 | void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) | 814 | void 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 | } |
diff --git a/linden/indra/newview/llviewerobjectlist.h b/linden/indra/newview/llviewerobjectlist.h index 07920cb..5999da3 100644 --- a/linden/indra/newview/llviewerobjectlist.h +++ b/linden/indra/newview/llviewerobjectlist.h | |||
@@ -182,7 +182,7 @@ public: | |||
182 | const U32 ip, | 182 | const U32 ip, |
183 | const U32 port); // Requires knowledge of message system info! | 183 | const U32 port); // Requires knowledge of message system info! |
184 | 184 | ||
185 | static BOOL removeFromLocalIDTable(const LLViewerObject &object); | 185 | static BOOL removeFromLocalIDTable(const LLViewerObject* objectp); |
186 | // Used ONLY by the orphaned object code. | 186 | // Used ONLY by the orphaned object code. |
187 | static U64 getIndex(const U32 local_id, const U32 ip, const U32 port); | 187 | static U64 getIndex(const U32 local_id, const U32 ip, const U32 port); |
188 | 188 | ||
@@ -200,8 +200,7 @@ protected: | |||
200 | 200 | ||
201 | LLDynamicArrayPtr<LLPointer<LLViewerObject> > mMapObjects; | 201 | LLDynamicArrayPtr<LLPointer<LLViewerObject> > mMapObjects; |
202 | 202 | ||
203 | typedef std::map<LLUUID, LLPointer<LLViewerObject> > vo_map; | 203 | std::set<LLUUID> mDeadObjects; |
204 | vo_map mDeadObjects; // Need to keep multiple entries per UUID | ||
205 | 204 | ||
206 | std::map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap; | 205 | std::map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap; |
207 | 206 | ||
diff --git a/linden/indra/newview/llvocache.cpp b/linden/indra/newview/llvocache.cpp index 3f1c132..20d0399 100644 --- a/linden/indra/newview/llvocache.cpp +++ b/linden/indra/newview/llvocache.cpp | |||
@@ -104,7 +104,10 @@ LLVOCacheEntry::LLVOCacheEntry(LLFILE *fp) | |||
104 | 104 | ||
105 | LLVOCacheEntry::~LLVOCacheEntry() | 105 | LLVOCacheEntry::~LLVOCacheEntry() |
106 | { | 106 | { |
107 | delete [] mBuffer; | 107 | if (mBuffer) |
108 | { | ||
109 | delete [] mBuffer; | ||
110 | } | ||
108 | } | 111 | } |
109 | 112 | ||
110 | 113 | ||