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
This commit is contained in:
Roberto Fernandez Bautista 2021-04-05 18:51:48 +01:00 committed by Seth Hillbrand
parent f21111fda6
commit 7d9ee76f64
1 changed files with 1 additions and 1 deletions

View File

@ -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,