diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-01-28 12:55:38 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-01-28 12:55:38 +0800 |
commit | 1f8eb029e0a178a8d0140c92298e40bdd8a902ba (patch) | |
tree | 27ad00229cb36a975342298b9b9c431965573f24 /indra/newview | |
parent | eea8d598f53b92e995f2b259ffb2ac452d028d72 (diff) | |
parent | 43a966eea43e5df361da68cbb1da3e1b1f38a03b (diff) |
Merge remote-tracking branch 'secondlife/release/2024.12-ForeverFPS' into 2024.12-ForeverFPS2024.12-ForeverFPS
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 25 |
2 files changed, 23 insertions, 13 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 946d674e8b..4e0c5d7df0 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -537,9 +537,14 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() selfStopPhase("update_appearance_on_destroy"); - LLAppearanceMgr::instance().updateAppearanceFromCOF(mEnforceItemRestrictions, - mEnforceOrdering, - mPostUpdateFunc); + //avoid calling an update inside coroutine + bool force_restrictions(mEnforceItemRestrictions); + bool enforce_ordering(mEnforceOrdering); + nullary_func_t post_update_func(mPostUpdateFunc); + doOnIdleOneTime([force_restrictions,enforce_ordering,post_update_func]() + { + LLAppearanceMgr::instance().updateAppearanceFromCOF(force_restrictions, enforce_ordering, post_update_func); + }); } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index cd9d152437..d72d428c08 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1466,20 +1466,25 @@ void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp) { S32 idx = objectp->getListIndex(); if (idx != -1) - { //remove by moving last element to this object's position - llassert(mActiveObjects[idx] == objectp); - + { objectp->setListIndex(-1); - S32 last_index = static_cast<S32>(mActiveObjects.size()) - 1; - - if (idx != last_index) + S32 size = (S32)mActiveObjects.size(); + if (size > 0) // mActiveObjects could have been cleaned already { - mActiveObjects[idx] = mActiveObjects[last_index]; - mActiveObjects[idx]->setListIndex(idx); - } + // Remove by moving last element to this object's position - mActiveObjects.pop_back(); + llassert(idx < size); // idx should be always within mActiveObjects, unless killAllObjects was called + llassert(mActiveObjects[idx] == objectp); // object should be there + + S32 last_index = size - 1; + if (idx < last_index) + { + mActiveObjects[idx] = mActiveObjects[last_index]; + mActiveObjects[idx]->setListIndex(idx); + } // else assume it's the last element, no need to swap + mActiveObjects.pop_back(); + } } } |