Fix another instance of modifying iterators

We cannot modify the ee_rtree while iterating over it without
invalidating the iterators

Fixes https://gitlab.com/kicad/code/kicad/issues/7331
This commit is contained in:
Seth Hillbrand 2021-01-29 08:33:01 -08:00
parent 8aac6cb607
commit 02954dfaa1
1 changed files with 5 additions and 0 deletions

View File

@ -905,7 +905,12 @@ void SCH_LINE_WIRE_BUS_TOOL::finishSegments()
// Correct and remove segments that need to be merged.
m_frame->SchematicCleanUp();
std::vector<SCH_ITEM*> components;
for( SCH_ITEM* item : m_frame->GetScreen()->Items().OfType( SCH_COMPONENT_T ) )
components.push_back( item );
for( SCH_ITEM* item : components )
{
std::vector<wxPoint> pts = item->GetConnectionPoints();