From d1265cda36f31d0273b0cd57e1e6c762dfc0b29f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 20 May 2022 00:14:12 +0300 Subject: SL-17425 Crash when closing two dependent floaters dependent_it in llfloater was not valid after dependent floater removed itself from the list --- indra/llui/llfloater.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'indra/llui/llfloater.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 0e42922543..f4e395a0b8 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -761,17 +761,13 @@ void LLFloater::closeFloater(bool app_quitting) for(handle_set_iter_t dependent_it = mDependents.begin(); dependent_it != mDependents.end(); ) { - LLFloater* floaterp = dependent_it->get(); - if (floaterp) - { - ++dependent_it; - floaterp->closeFloater(app_quitting); - } - else - { - mDependents.erase(dependent_it++); - } + dependent_it = mDependents.erase(dependent_it); + if (floaterp) + { + floaterp->mDependeeHandle = LLHandle(); + floaterp->closeFloater(app_quitting); + } } cleanupHandles(); @@ -1439,7 +1435,7 @@ void LLFloater::cleanupHandles() LLFloater* floaterp = dependent_it->get(); if (!floaterp) { - mDependents.erase(dependent_it++); + dependent_it = mDependents.erase(dependent_it); } else { -- cgit v1.2.3