Merge branch 'macos-dvc-isdeleting'

Fix crash in wxDataViewModel::Cleared() under Mac.

See #22025.
This commit is contained in:
Vadim Zeitlin
2022-02-04 02:28:55 +01:00
6 changed files with 72 additions and 24 deletions

View File

@@ -145,6 +145,21 @@ void MyMusicTreeModel::Delete( const wxDataViewItem &item )
// notify control
ItemDeleted( parent, item );
}
void MyMusicTreeModel::Clear()
{
m_pop = NULL;
m_classical = NULL;
m_ninth = NULL;
while (!m_root->GetChildren().IsEmpty())
{
MyMusicTreeModelNode* node = m_root->GetNthChild(0);
m_root->GetChildren().Remove(node);
delete node;
}
Cleared();
}
int MyMusicTreeModel::Compare( const wxDataViewItem &item1, const wxDataViewItem &item2,
unsigned int column, bool ascending ) const