summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-04-07 16:29:06 -0700
committerRichard Linden <none@none>2010-04-07 16:29:06 -0700
commitdae4f63daaa1b42fcd90a07f9f269b222c637ef8 (patch)
tree006cadbdaf4d600481bc202f8df46f8fbeaae947 /indra/newview
parent87cce27de3dd23a40d812a7c9000b1972cb4bca3 (diff)
EXT-6693 - [crashhunters] crash in LLPopupView::handleMouseEvent
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpopupview.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp
index b010f4d72f..7cde350d5a 100644
--- a/indra/newview/llpopupview.cpp
+++ b/indra/newview/llpopupview.cpp
@@ -104,8 +104,13 @@ BOOL LLPopupView::handleMouseEvent(boost::function<BOOL(LLView*, S32, S32)> func
S32 x, S32 y,
bool close_popups)
{
- for (popup_list_t::iterator popup_it = mPopups.begin();
- popup_it != mPopups.end();)
+ BOOL handled = FALSE;
+
+ // make a copy of list of popups, in case list is modified during mouse event handling
+ popup_list_t popups(mPopups);
+ for (popup_list_t::iterator popup_it = popups.begin(), popup_end = popups.end();
+ popup_it != popup_end;
+ ++popup_it)
{
LLView* popup = popup_it->get();
if (!popup
@@ -121,23 +126,19 @@ BOOL LLPopupView::handleMouseEvent(boost::function<BOOL(LLView*, S32, S32)> func
{
if (func(popup, popup_x, popup_y))
{
- return TRUE;
+ handled = TRUE;
+ break;
}
}
if (close_popups)
{
- popup_list_t::iterator cur_popup_it = popup_it++;
- mPopups.erase(cur_popup_it);
+ mPopups.remove(*popup_it);
popup->onTopLost();
}
- else
- {
- ++popup_it;
- }
}
- return FALSE;
+ return handled;
}