diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-07-26 19:32:23 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-07-29 19:50:28 +0200 |
commit | 5d25504f8335132d0d222b266f8772062c88b335 (patch) | |
tree | d60ac8e9da7177063ede71908d65134802c1ceed /indra/llcharacter | |
parent | 7a4249937db591d146d8c91f2a85c5c721543f19 (diff) |
#2100 BugSplat Crash #1497210: LLVOAvatar::updateImpostors()(10616)
Diffstat (limited to 'indra/llcharacter')
-rw-r--r-- | indra/llcharacter/llcharacter.cpp | 23 | ||||
-rw-r--r-- | indra/llcharacter/llcharacter.h | 2 | ||||
-rw-r--r-- | indra/llcharacter/llkeyframemotion.cpp | 11 |
3 files changed, 8 insertions, 28 deletions
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 264b9a0be1..ecbcdb3bf5 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -38,7 +38,7 @@ LLStringTable LLCharacter::sVisualParamNames(1024); -std::vector< LLCharacter* > LLCharacter::sInstances; +std::list< LLCharacter* > LLCharacter::sInstances; bool LLCharacter::sAllowInstancesChange = true ; //----------------------------------------------------------------------------- @@ -53,7 +53,6 @@ LLCharacter::LLCharacter() mSkeletonSerialNum( 0 ) { llassert_always(sAllowInstancesChange) ; - sInstances.push_back(this); mMotionController.setCharacter( this ); mPauseRequest = new LLPauseRequestHandle(); @@ -66,28 +65,12 @@ LLCharacter::LLCharacter() //----------------------------------------------------------------------------- LLCharacter::~LLCharacter() { - for (LLVisualParam *param = getFirstVisualParam(); - param; - param = getNextVisualParam()) + for (const auto& it : mVisualParamIndexMap) { - delete param; + delete it.second; } - size_t i ; - size_t size = sInstances.size() ; - for(i = 0 ; i < size ; i++) - { - if(sInstances[i] == this) - { - break ; - } - } - - llassert_always(i < size) ; - llassert_always(sAllowInstancesChange) ; - sInstances[i] = sInstances[size - 1] ; - sInstances.pop_back() ; } diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index b390960a75..6da28f0692 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -255,7 +255,7 @@ public: U32 getSkeletonSerialNum() const { return mSkeletonSerialNum; } void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; } - static std::vector< LLCharacter* > sInstances; + static std::list< LLCharacter* > sInstances; static bool sAllowInstancesChange ; //debug use virtual void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) { mHoverOffset = hover_offset; } diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 12212efb66..6c060d7980 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -2407,13 +2407,10 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid, { LLUUID* id = (LLUUID*)user_data; - std::vector<LLCharacter* >::iterator char_iter = LLCharacter::sInstances.begin(); - - while(char_iter != LLCharacter::sInstances.end() && - (*char_iter)->getID() != *id) - { - ++char_iter; - } + auto char_iter = std::find_if(LLCharacter::sInstances.begin(), LLCharacter::sInstances.end(), [&](LLCharacter* c) + { + return c->getID() == *id; + }); delete id; |