aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-08-01 18:41:56 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit4cb39096ded770bfc4cf9712b85ed38e66c0e3f7 (patch)
tree6733c7b4b71b56b75a890f87c1bc94ab4d93d5f7
parent90367493ec62da19c3251547b328c9d7be60e7a5 (diff)
downloadComputeLibrary-4cb39096ded770bfc4cf9712b85ed38e66c0e3f7.tar.gz
COMPMID-1439: Fix invalidation of iterator while iterating
Change-Id: I0d253e6047216cfbd57dc807881c2b24d82c47f5 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/142357 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
-rw-r--r--src/graph/Graph.cpp7
1 files 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<EdgeID> output_edges_copy = node->output_edges();
+ for(auto &outpud_eid : output_edges_copy)
{
remove_connection(outpud_eid);
}