]> git.saurik.com Git - wxWidgets.git/commitdiff
Close wxDataViewCtrl inline editor when destroying the control.
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 14 Dec 2011 16:00:30 +0000 (16:00 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 14 Dec 2011 16:00:30 +0000 (16:00 +0000)
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

index febc1d1bf4674790497fdd257280e5e6e07ebe0c..79b97c5c4173c84c85eb5aa7940ab27383f6298b 100644 (file)
@@ -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()