diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 1f4a68a4f0..9be2545d17 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -2430,7 +2430,9 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo // member to have the correct connection info if( conn->IsBus() && !stale_bus_members.empty() ) { - for( SCH_CONNECTION* stale_member : stale_bus_members ) + std::unordered_set cached_members = stale_bus_members; + + for( SCH_CONNECTION* stale_member : cached_members ) { for( CONNECTION_SUBGRAPH* subgraph : visited ) {