From 7d9ee76f64ae18cf2967f6c4885a7029ec4f9d25 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Mon, 5 Apr 2021 18:51:48 +0100 Subject: [PATCH] Don't iterate through m_selection if deleting items from it Use the copied container saved_selection instead Fixes https://gitlab.com/kicad/code/kicad/-/issues/8126 --- eeschema/tools/ee_selection_tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 0ce878014c..0244bf26b7 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -478,7 +478,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { EE_SELECTION saved_selection = m_selection; - for( const auto& item : m_selection ) + for( const auto& item : saved_selection ) RemoveItemFromSel( item, true ); SelectPoint( evt->Position(), EE_COLLECTOR::AllItems, nullptr,