summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-01-24 21:51:24 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-01-24 21:51:43 +0200
commit6dec98a14ca052a3600556815e6b215eed15e97d (patch)
treecd782c9ecb58b26272a5b6e55431b2271484d794
parent4c364dc07ed7d2726bf95101e6d14b2bd95939c3 (diff)
SL-17425 Crash when having more than one dependent floater #2
-rw-r--r--indra/llui/llfloater.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index d413fab270..2303cd24b7 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -759,11 +759,13 @@ void LLFloater::closeFloater(bool app_quitting)
}
// now close dependent floater
- for(handle_set_iter_t dependent_it = mDependents.begin();
- dependent_it != mDependents.end(); )
+ while(mDependents.size() > 0)
{
+ handle_set_iter_t dependent_it = mDependents.begin();
LLFloater* floaterp = dependent_it->get();
- dependent_it = mDependents.erase(dependent_it);
+ // normally removeDependentFloater will do this, but in
+ // case floaterp is somehow invalid or orphaned, erase now
+ mDependents.erase(dependent_it);
if (floaterp)
{
floaterp->mDependeeHandle = LLHandle<LLFloater>();