mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
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;
|
bool found = false;
|
||||||
|
|
||||||
if( m_view )
|
if( m_view )
|
||||||
|
{
|
||||||
m_view->UnselectAll();
|
m_view->UnselectAll();
|
||||||
|
wxYield();
|
||||||
|
m_view->Freeze();
|
||||||
|
}
|
||||||
|
|
||||||
for( int i = m_rcItemsProvider->GetCount() - 1; i >= 0; --i )
|
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 ] ) );
|
m_view->Select( ToItem( m_tree[ lastGood ] ) );
|
||||||
|
|
||||||
if( !aCurrentOnly )
|
if( !aCurrentOnly )
|
||||||
{
|
|
||||||
m_rcItemsProvider->DeleteAllItems( aIncludeExclusions, aDeep );
|
m_rcItemsProvider->DeleteAllItems( aIncludeExclusions, aDeep );
|
||||||
}
|
|
||||||
|
if( m_view )
|
||||||
|
m_view->Thaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user