Don't leave selection lying around when swapping out footprints.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14971

(cherry picked from commit da558f57d4)
This commit is contained in:
Jeff Young 2023-06-16 16:29:35 +01:00
parent d3099ecf75
commit 61dfe4ef07
1 changed files with 3 additions and 0 deletions

View File

@ -1238,6 +1238,9 @@ void FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint( int aMode )
setCurFootprintName( m_fpList->GetBaseString( selection ) );
// Delete the current footprint
if( PCB_SELECTION_TOOL* selectionTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>() )
selectionTool->ClearSelection( true /* quiet mode */ );
GetBoard()->DeleteAllFootprints();
GetBoard()->GetNetInfo().RemoveUnusedNets();