Reverting part of cee973dc04

Iterators are invalidated by vector reallocation.  We need to keep the
count in the loop in order to have a valid position in the vector

Fixes https://gitlab.com/kicad/code/kicad/issues/4073
This commit is contained in:
Seth Hillbrand 2020-03-20 08:38:42 -07:00
parent e9cd9ee8ff
commit ba8c3a5582
1 changed files with 3 additions and 1 deletions

View File

@ -1624,8 +1624,10 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph )
visit( aSubgraph ); visit( aSubgraph );
for( CONNECTION_SUBGRAPH* child : search_list ) for( unsigned i = 0; i < search_list.size(); i++ )
{ {
auto child = search_list[i];
visited.insert( child ); visited.insert( child );
visit( child ); visit( child );