From 4cb39096ded770bfc4cf9712b85ed38e66c0e3f7 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 1 Aug 2018 18:41:56 +0100 Subject: COMPMID-1439: Fix invalidation of iterator while iterating Change-Id: I0d253e6047216cfbd57dc807881c2b24d82c47f5 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/142357 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- src/graph/Graph.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/graph/Graph.cpp b/src/graph/Graph.cpp index ed24f18943..88e2682c86 100644 --- a/src/graph/Graph.cpp +++ b/src/graph/Graph.cpp @@ -43,12 +43,15 @@ bool Graph::remove_node(NodeID nid) if(node) { - // Remove node connections + // Remove input connections for(auto &input_eid : node->_input_edges) { remove_connection(input_eid); } - for(auto &outpud_eid : node->_output_edges) + + // Remove output connections + std::set output_edges_copy = node->output_edges(); + for(auto &outpud_eid : output_edges_copy) { remove_connection(outpud_eid); } -- cgit v1.2.1