]> git.saurik.com Git - wxWidgets.git/commitdiff
don't crash if the grid is being deleted while a cell editor is still shown (closes...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Sep 2008 16:12:46 +0000 (16:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Sep 2008 16:12:46 +0000 (16:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index e8ca4e0102b6308b6c98b572587a907a9b1954dc..708baf71b01ba0e1974229c6411a461d0ec9c4c5 100644 (file)
@@ -4532,6 +4532,11 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id,
 
 wxGrid::~wxGrid()
 {
+    // Ensure that the editor control is destroyed before the grid is,
+    // otherwise we crash later when the editor tries to do something with the
+    // half destroyed grid
+    HideCellEditControl();
+
     // Must do this or ~wxScrollHelper will pop the wrong event handler
     SetTargetWindow(this);
     ClearAttrCache();