From 8874ac39c1928bcb70c4f63cd3cfaeb75712d00e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 24 Oct 2011 17:06:48 -0700 Subject: EXP-1462 FIX -- Moving speak button or voice settings button between toolbars can cause viewer to crash on Mac * Updated iterator code to not erase stuff while we're iterating through it! Reviewed by Richard. --- indra/newview/lltransientfloatermgr.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index d15efb048b..3d68c10489 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -104,6 +104,8 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y) { + std::list< LLHandle > dead_handles; + bool res = true; for (controls_set_t::iterator it = set.begin(); it != set.end(); it++) @@ -113,7 +115,7 @@ bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set LLHandle handle = *it; if (handle.isDead()) { - mGroupControls.find(group)->second.erase(handle); + dead_handles.push_back(handle); continue; } @@ -132,6 +134,13 @@ bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set break; } } + + for (std::list< LLHandle >::iterator it = dead_handles.begin(); it != dead_handles.end(); ++it) + { + LLHandle handle = *it; + mGroupControls.find(group)->second.erase(handle); + } + return res; } -- cgit v1.2.3