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.
master
Leslie Linden 2011-10-24 17:06:48 -07:00
parent c4387cbdb9
commit 8874ac39c1
1 changed files with 10 additions and 1 deletions

View File

@ -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<LLView> > 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<LLView> 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<LLView> >::iterator it = dead_handles.begin(); it != dead_handles.end(); ++it)
{
LLHandle<LLView> handle = *it;
mGroupControls.find(group)->second.erase(handle);
}
return res;
}