From a85b4023d15183d826fec483d573eae6464e4942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 14 Dec 2011 16:00:30 +0000 Subject: [PATCH] Close wxDataViewCtrl inline editor when destroying the control. If the wxDataViewCtrl control was destroyed while an inline editor control was still active, it wouldn't get destroyed in the right order and the ~wxWindow assert about unpopped event handlers would be triggered. Fix this by popping the handler as one of the first things in wxDataViewRendererBase destructor. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datavcmn.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index febc1d1bf4..79b97c5c41 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -672,6 +672,8 @@ wxDataViewRendererBase::wxDataViewRendererBase( const wxString &varianttype, wxDataViewRendererBase::~wxDataViewRendererBase() { + if ( m_editorCtrl ) + DestroyEditControl(); } wxDataViewCtrl* wxDataViewRendererBase::GetView() const @@ -740,6 +742,8 @@ void wxDataViewRendererBase::DestroyEditControl() wxPendingDelete.Append(handler); wxPendingDelete.Append(m_editorCtrl); + + m_editorCtrl = NULL; } void wxDataViewRendererBase::CancelEditing()