diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-02-29 23:00:08 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-03-01 18:01:51 +0200 |
commit | d47c6536820d1ed6e373147678dd0fab90e80ab8 (patch) | |
tree | e6e456ede493e12625900b71d280c3c6b637f83b /indra | |
parent | eb01d6f770df757172d3b1173f3e0865ece25b81 (diff) |
triage#105 clearPopups() crash
onTopLost can result in popup being removed or potentially removing more
than one popup.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpopupview.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index 49645eec11..aadef9a308 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -256,16 +256,16 @@ void LLPopupView::removePopup(LLView* popup) void LLPopupView::clearPopups() { - for (popup_list_t::iterator popup_it = mPopups.begin(); - popup_it != mPopups.end();) + while (!mPopups.empty()) { - LLView* popup = popup_it->get(); + popup_list_t::iterator popup_it = mPopups.begin(); + LLView* popup = popup_it->get(); + // Remove before notifying in case it will cause removePopup + mPopups.erase(popup_it); if (popup) { popup->onTopLost(); } - - popup_it = mPopups.erase(popup_it); } } |