]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed use of map::erase() in ClearActionTriggers() (this bug was revealed by static...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 14 Sep 2009 14:53:13 +0000 (14:53 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 14 Sep 2009 14:53:13 +0000 (14:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/propgrid.cpp

index fcad2acd940222c707b26d7e33b66dd933c2079f..4eb852079980af56bc9b1002f6b133ee4ed92312 100644 (file)
@@ -5232,14 +5232,25 @@ void wxPropertyGrid::AddActionTrigger( int action, int keycode, int modifiers )
 void wxPropertyGrid::ClearActionTriggers( int action )
 {
     wxPGHashMapI2I::iterator it;
+    bool didSomething;
 
-    for ( it = m_actionTriggers.begin(); it != m_actionTriggers.end(); ++it )
+    do
     {
-        if ( it->second == action )
+        didSomething = false;
+
+        for ( it = m_actionTriggers.begin();
+              it != m_actionTriggers.end();
+              it++ )
         {
-            m_actionTriggers.erase(it);
+            if ( it->second == action )
+            {
+                m_actionTriggers.erase(it);
+                didSomething = true;
+                break;
+            }
         }
     }
+    while ( didSomething );
 }
 
 void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )