diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index b8b81260a1..5f3674d1d6 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1056,9 +1056,10 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { // Check for items becoming invisible and drop them from the selection. - LSET visible = editFrame->GetBoard()->GetVisibleLayers(); + 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( eda_item );