From 61dfe4ef07489cfbb89d99ddfee43e6b256dad1e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 16 Jun 2023 16:29:35 +0100 Subject: [PATCH] Don't leave selection lying around when swapping out footprints. Fixes https://gitlab.com/kicad/code/kicad/-/issues/14971 (cherry picked from commit da558f57d412d0f060756820a173b4f9981bbb89) --- pcbnew/footprint_viewer_frame.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index ae7955aa3f..8f928f3bc8 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -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() ) + selectionTool->ClearSelection( true /* quiet mode */ ); + GetBoard()->DeleteAllFootprints(); GetBoard()->GetNetInfo().RemoveUnusedNets();