]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix fatal bug when changing wxDataViewCtrl model in wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 9 Nov 2009 01:57:47 +0000 (01:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 9 Nov 2009 01:57:47 +0000 (01:57 +0000)
wxDataViewCtrl::AssociateModel() wrongly delete m_notifier itself if the
control already had a model even though the notifier was registered using
AddNotifier() which also scheduled it for deletion when the old model itself
was destroyed. This resulted in double deletion and reproducible crash
whenever the model was changed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dataview.cpp

index 5bb7d75031d8e815862c1a97b594759120879e79..a35bbbd9f8d071dcc3c70d68e27e826f152073f8 100644 (file)
@@ -4214,13 +4214,10 @@ void wxDataViewCtrl::OnInternalIdle()
 
 bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
 {
-    if (GetModel())
+    if ( m_internal )
     {
         delete m_internal;
         m_internal = NULL;
-
-        delete m_notifier;
-        m_notifier = NULL;
     }
 
     if (!wxDataViewCtrlBase::AssociateModel( model ))