]> git.saurik.com Git - wxWidgets.git/commitdiff
don't skip the event in wxGridCellEditorEvtHandler::OnKillFocus() to fix crashes...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 17 Feb 2009 16:43:10 +0000 (16:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 17 Feb 2009 16:43:10 +0000 (16:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grideditors.cpp

index 997626c10e5863c90f7299edaac8b11b9d901278..1ece439bf7749e83f3c2d1ded181e1622a1c789b 100644 (file)
 void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event)
 {
     // Don't disable the cell if we're just starting to edit it
-    if (m_inSetFocus)
+    if ( m_inSetFocus )
+    {
+        event.Skip();
         return;
+    }
 
     // accept changes
     m_grid->DisableCellEditControl();
 
-    event.Skip();
+    // notice that we must not skip the event here because the call above may
+    // delete the control which received the kill focus event in the first
+    // place and if we pretend not having processed the event, the search for a
+    // handler for it will continue using the now deleted object resulting in a
+    // crash
 }
 
 void wxGridCellEditorEvtHandler::OnKeyDown(wxKeyEvent& event)