Commits

leslie_linden committed 2a05735

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.

  • Participants
  • Parent commits e7004fd

Comments (0)

Files changed (1)

indra/newview/lltransientfloatermgr.cpp

 
 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++)
 		LLHandle<LLView> handle = *it;
 		if (handle.isDead())
 		{
-			mGroupControls.find(group)->second.erase(handle);
+			dead_handles.push_back(handle);
 			continue;
 		}
 
 			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;
 }