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
This commit is contained in:
Seth Hillbrand 2022-11-29 13:36:02 -08:00
parent abd818a426
commit 4f4e355ce5
1 changed files with 3 additions and 0 deletions

View File

@ -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;
};