From 4f4e355ce5ab3f89184f4f3b2d4cb0cd9020b98a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 29 Nov 2022 13:36:02 -0800 Subject: [PATCH] Reset existingRefs on cancel When placing, we need to keep our static pointer map valid. If we cancel the placement after annotation, we need to remove the annotated symbol. The safer way is to just recreate the map Fixes https://gitlab.com/kicad/code/kicad/issues/12983 --- eeschema/tools/sch_drawing_tools.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 2ca723a67f..bb2d8d8d62 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -172,6 +172,9 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) { m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); m_frame->RollbackSchematicFromUndo(); + existingRefs.Clear(); + hierarchy.GetSymbols( existingRefs ); + existingRefs.SortByReferenceOnly(); symbol = nullptr; };