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/trunk@55798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-09-22 16:12:46 +00:00
parent ed9dd91465
commit b09b3048c9

View File

@@ -4532,6 +4532,11 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id,
wxGrid::~wxGrid() 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 // Must do this or ~wxScrollHelper will pop the wrong event handler
SetTargetWindow(this); SetTargetWindow(this);
ClearAttrCache(); ClearAttrCache();