diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-01-16 20:57:23 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-01-17 19:19:16 +0200 |
commit | b1bd083728d0fb630abdff64cd57cefb833bd0b9 (patch) | |
tree | 46af910e747ec276d20237885905d6581a3651d9 | |
parent | 6dc819e22aaf35054764a57dc51bb0ed629c6703 (diff) |
#3413 Crash at removeFromLocalIDTable
Callstacks indicate that this happens only on shutdown.
No point to erase items one at a time, just clear the list beforehand.
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index d667fdbea8..d8f446db05 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1309,7 +1309,10 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) // << objectp->getRegion()->getHost().getPort() << LL_ENDL; //} - removeFromLocalIDTable(objectp); + if (!mIndexAndLocalIDToUUID.empty()) + { + removeFromLocalIDTable(objectp); + } if (objectp->onActiveList()) { @@ -1381,11 +1384,19 @@ void LLViewerObjectList::killObjects(LLViewerRegion *regionp) void LLViewerObjectList::killAllObjects() { // Used only on global destruction. - LLViewerObject *objectp; + // Mass cleanup to not clear lists one item at a time + mIndexAndLocalIDToUUID.clear(); + mActiveObjects.clear(); + mMapObjects.clear(); + + LLViewerObject *objectp; for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { objectp = *iter; + objectp->setOnActiveList(false); + objectp->setListIndex(-1); + objectp->mOnMap = false; killObject(objectp); // Object must be dead, or it's the LLVOAvatarSelf which never dies. llassert((objectp == gAgentAvatarp) || objectp->isDead()); @@ -1398,18 +1409,6 @@ void LLViewerObjectList::killAllObjects() LL_WARNS() << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << LL_ENDL; mObjects.clear(); } - - if (!mActiveObjects.empty()) - { - LL_WARNS() << "Some objects still on active object list!" << LL_ENDL; - mActiveObjects.clear(); - } - - if (!mMapObjects.empty()) - { - LL_WARNS() << "Some objects still on map object list!" << LL_ENDL; - mMapObjects.clear(); - } } void LLViewerObjectList::cleanDeadObjects(bool use_timer) |