diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 1859b289d2..65fb498f6e 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -551,6 +551,11 @@ outlineView:(NSOutlineView*)outlineView { wxUnusedVar(outlineView); + // See the comment in outlineView:objectValueForTableColumn:byItem: below: + // this function can also be called in the same circumstances. + if ( implementation->GetDataViewCtrl()->IsDeleting() ) + return nil; + if ((item == currentParentItem) && (index < ((NSInteger) [self getChildCount]))) return [self getChild:index]; diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp index 2a881bad4c..4b4214e439 100644 --- a/src/osx/dataview_osx.cpp +++ b/src/osx/dataview_osx.cpp @@ -251,7 +251,14 @@ bool wxOSXDataViewModelNotifier::ValueChanged(wxDataViewItem const& item, unsign bool wxOSXDataViewModelNotifier::Cleared() { - return m_DataViewCtrlPtr->GetDataViewPeer()->Reload(); + bool noFailureFlag; + + // NOTE: See comments in ItemDeleted method above + m_DataViewCtrlPtr->SetDeleting(true); + noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Reload(); + m_DataViewCtrlPtr->SetDeleting(false); + + return noFailureFlag; } void wxOSXDataViewModelNotifier::Resort()