pcbnew: Clear items before deleting vertex
Reverting changes causes the item to become invalid. This can cause issues when we have dangling pointers for the VIEW routines left over. Until we implement a method of passing the reverted element back up to the calling routine, we need to remove the selection for each Revert() call. Fixes: lp:1821909 * https://bugs.launchpad.net/kicad/+bug/1821909
This commit is contained in:
parent
88faac309f
commit
7ee12d674e
|
@ -1165,12 +1165,10 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
setEditedPoint( nullptr );
|
||||
updatePoints();
|
||||
|
||||
if( valid )
|
||||
{
|
||||
commit.Push( _( "Remove a zone/polygon corner" ) );
|
||||
else
|
||||
commit.Revert();
|
||||
|
||||
// Refresh zone hatching
|
||||
if( item->Type() == PCB_ZONE_AREA_T)
|
||||
|
@ -1178,6 +1176,14 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
|
|||
|
||||
updatePoints();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
getView()->Remove( m_editPoints.get() );
|
||||
commit.Revert();
|
||||
m_editPoints.reset();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue