Fix fatal bug when changing wxDataViewCtrl model in wxGTK.

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
This commit is contained in:
Vadim Zeitlin
2009-11-09 01:57:47 +00:00
parent 80093617fe
commit c8b6d5a049

View 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 ))