Don't crash when canceling graphics import
Grouped graphics need to have their group removed from the preview before deleting the elements to avoid reading freed memory when redrawing
This commit is contained in:
parent
16db0440ba
commit
47d86e5d9e
|
@ -1602,6 +1602,12 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||||
|
|
||||||
|
if( group )
|
||||||
|
{
|
||||||
|
preview.Remove( group );
|
||||||
|
group->RemoveAll();
|
||||||
|
}
|
||||||
|
|
||||||
for( BOARD_ITEM* item : newItems )
|
for( BOARD_ITEM* item : newItems )
|
||||||
delete item;
|
delete item;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue