summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp23
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();