Add some defensive code to try and prevent freed pointer access.
Fixes https://gitlab.com/kicad/code/kicad/issues/5747
This commit is contained in:
parent
81154c9270
commit
44b23dd3d1
|
@ -436,7 +436,11 @@ void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, boo
|
|||
bool found = false;
|
||||
|
||||
if( m_view )
|
||||
{
|
||||
m_view->UnselectAll();
|
||||
wxYield();
|
||||
m_view->Freeze();
|
||||
}
|
||||
|
||||
for( int i = m_rcItemsProvider->GetCount() - 1; i >= 0; --i )
|
||||
{
|
||||
|
@ -484,9 +488,10 @@ void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, boo
|
|||
m_view->Select( ToItem( m_tree[ lastGood ] ) );
|
||||
|
||||
if( !aCurrentOnly )
|
||||
{
|
||||
m_rcItemsProvider->DeleteAllItems( aIncludeExclusions, aDeep );
|
||||
}
|
||||
|
||||
if( m_view )
|
||||
m_view->Thaw();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue