Fix crash bug in marker deletion.

This commit is contained in:
Jeff Young 2020-10-28 10:44:18 +00:00
parent 8d4c9aeaac
commit ae77dfc455
1 changed files with 17 additions and 14 deletions

View File

@ -469,6 +469,8 @@ void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, boo
found = true;
if( i < (int) m_tree.size() ) // Careful; tree is truncated for large datasets
{
wxDataViewItem markerItem = ToItem( m_tree[i] );
wxDataViewItemArray childItems;
wxDataViewItem parentItem = ToItem( m_tree[i]->m_Parent );
@ -485,6 +487,7 @@ void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, boo
delete m_tree[i];
m_tree.erase( m_tree.begin() + i );
ItemDeleted( parentItem, markerItem );
}
// Only deep delete the current item here; others will be done through the
// DeleteAllItems() call below, which is more efficient.