diff options
| author | Kitty Barnett <develop@catznip.com> | 2024-08-30 01:03:23 +0200 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-03-15 21:55:33 +0200 |
| commit | 6c6d618f6db3941e95223a49f1daf8f6a05346a2 (patch) | |
| tree | 63c38a55c75cc03ff32d9f8b36b1db2cd786d19f /indra | |
| parent | b2a22e1a9bfe93d72503492f4d6096567e164937 (diff) | |
If multiple LLWearableHoldingPattern instances are waiting for completion, only the most recently created one should progress
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llappearancemgr.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4bc9c55019..5845477554 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -703,6 +703,7 @@ public: void onFetchCompletion(); bool isFetchCompleted(); bool isTimedOut(); + bool pollStopped(); void checkMissingWearables(); bool pollMissingWearables(); @@ -947,6 +948,10 @@ bool LLWearableHoldingPattern::pollFetchCompletion() { // runway skip here? LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL; + + // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves + doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this)); + return true; } bool completed = isFetchCompleted(); @@ -1017,6 +1022,9 @@ void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLView { // runway skip here? LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL; + + // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves + return; } LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL; @@ -1067,12 +1075,27 @@ bool LLWearableHoldingPattern::isMissingCompleted() return mTypesToLink.size()==0 && mTypesToRecover.size()==0; } +bool LLWearableHoldingPattern::pollStopped() +{ + // We have to keep on polling until we're sure that all callbacks have completed or they'll cause a crash + if (isFetchCompleted() && isMissingCompleted()) + { + delete this; + return true; + } + return false; +} + bool LLWearableHoldingPattern::pollMissingWearables() { if (!isMostRecent()) { // runway skip here? LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL; + + // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves + doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this)); + return true; } bool timed_out = isTimedOut(); |
