Fatal exception fixed in DVC on macOS while wxDataViewModel::Cleared call + editing item.

This commit is contained in:
valid-ptr
2022-01-17 22:37:07 +03:00
committed by konstantin.matveyev
parent 32eb4af061
commit 8aae7ad937
2 changed files with 13 additions and 1 deletions

View File

@@ -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];

View File

@@ -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()