From 71e9f07df1e998f6180918cf48f80030a3498864 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Sep 2008 16:12:46 +0000 Subject: [PATCH] don't crash if the grid is being deleted while a cell editor is still shown (closes #9991) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 86738f9e3a..552a7a61d1 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4315,6 +4315,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();