Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#15910 closed defect (fixed)

wxDataViewCtrl AssociateModel crash when model is replaced

Reported by: johnr Owned by:
Priority: normal Milestone:
Component: wxOSX-Cocoa Version: dev-latest
Keywords: wxDataViewCtrl AssociateModel new model Cc:
Blocked By: Blocking:
Patch: yes

Description

dataview_osx.cpp/wxDataViewCtrl::AssociateModel calls RemoveNotifier(m_ModelNotifier) to DeleteObject( notifier ).

In a situation where the associate model is NULL or the wxDataViewCtrlBase::AssociateModel call fails then m_ModelNotifier is not replaced with m_ModelNotifier = new wxOSXDataViewModelNotifier and remains as an invalid address and crashes when an notifier list iterator call GetData().

Patch attached.

Attachments (1)

dataview_osx_cpp.patch download (562 bytes) - added by johnr 9 months ago.

Download all attachments as: .zip

Change History (3)

Changed 9 months ago by johnr

comment:1 Changed 9 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [75707]) 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.

comment:2 Changed 9 months ago by VZ

(In [75711]) 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.

Note: See TracTickets for help on using tickets.