Iterate on a copy of the selection since we're going to delete from it.

Fixes https://gitlab.com/kicad/code/kicad/issues/12484
This commit is contained in:
Jeff Young 2022-09-27 23:53:47 +01:00
parent 4bbf942f15
commit 3a7068b346
1 changed files with 3 additions and 2 deletions

View File

@ -1056,9 +1056,10 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
{
// Check for items becoming invisible and drop them from the selection.
PCB_SELECTION selCopy = selection;
LSET visible = editFrame->GetBoard()->GetVisibleLayers();
for( EDA_ITEM* eda_item : selection )
for( EDA_ITEM* eda_item : selCopy )
{
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( eda_item );