From 02954dfaa1568a50b26b32f6cb71e5ce2aced48f Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 29 Jan 2021 08:33:01 -0800 Subject: [PATCH] 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 --- eeschema/tools/sch_line_wire_bus_tool.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index d9f8b0e6c4..0bee42b1e7 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -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 components; + for( SCH_ITEM* item : m_frame->GetScreen()->Items().OfType( SCH_COMPONENT_T ) ) + components.push_back( item ); + + for( SCH_ITEM* item : components ) { std::vector pts = item->GetConnectionPoints();