Don't leave dandling pointers in wxDataViewCtrl in wxOSX.

The previous m_ModelNotifier became invalid but wasn't always replaced with a
valid one, resulting in a crash due to the use of an invalid pointer.

Closes #15910.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-01-25 17:39:28 +00:00
parent 5f30588ebd
commit 7048cf7174

View File

@@ -390,7 +390,10 @@ bool wxDataViewCtrl::AssociateModel(wxDataViewModel* model)
// We could have been associated with another model previously, break the
// association in this case.
if ( m_ModelNotifier )
{
m_ModelNotifier->GetOwner()->RemoveNotifier(m_ModelNotifier);
m_ModelNotifier = NULL;
}
if (wxDataViewCtrlBase::AssociateModel(model) && dataViewWidgetPtr->AssociateModel(model))
{