Browse Source

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
7.0
Seth Hillbrand 3 years ago
parent
commit
47d86e5d9e
  1. 6
      pcbnew/tools/drawing_tool.cpp

6
pcbnew/tools/drawing_tool.cpp

@ -1602,6 +1602,12 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
if( group )
{
preview.Remove( group );
group->RemoveAll();
}
for( BOARD_ITEM* item : newItems )
delete item;

Loading…
Cancel
Save