From 7048cf717454dd9b6f191e949efd9659832f6755 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 25 Jan 2014 17:39:28 +0000 Subject: [PATCH] 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 --- src/osx/dataview_osx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp index 799e752e15..fd861deb39 100644 --- a/src/osx/dataview_osx.cpp +++ b/src/osx/dataview_osx.cpp @@ -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)) {