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:
@@ -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))
|
||||
{
|
||||
|
Reference in New Issue
Block a user