From 2f317a0949be55f2d5bef970cb4e9bea85bc4062 Mon Sep 17 00:00:00 2001 From: Glenn Hickey Date: Mon, 22 Jul 2024 16:14:43 -0400 Subject: [PATCH] use destroy_paths() in clip --- deps/libbdsg | 2 +- src/clip.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/deps/libbdsg b/deps/libbdsg index a2e97dbf58e..757896a678e 160000 --- a/deps/libbdsg +++ b/deps/libbdsg @@ -1 +1 @@ -Subproject commit a2e97dbf58ef2dddbfac47fd8ea7b6d4f8ff3f26 +Subproject commit 757896a678eb7af7215147ef38cdb9315775dfe0 diff --git a/src/clip.cpp b/src/clip.cpp index 8b078619fc9..4b0934fde76 100644 --- a/src/clip.cpp +++ b/src/clip.cpp @@ -192,7 +192,8 @@ void delete_nodes_and_chop_paths(MutablePathMutableHandleGraph* graph, const uno vector path_handles; graph->for_each_path_handle([&](path_handle_t path_handle) { path_handles.push_back(path_handle); - }); + }); + vector paths_to_destroy; for (path_handle_t& path_handle : path_handles) { string path_name = graph->get_path_name(path_handle); @@ -257,10 +258,13 @@ void delete_nodes_and_chop_paths(MutablePathMutableHandleGraph* graph, const uno } if (was_chopped) { - graph->destroy_path(path_handle); + paths_to_destroy.push_back(path_handle); } } + // delete the paths + graph->destroy_paths(paths_to_destroy); + DeletableHandleGraph* del_graph = dynamic_cast(graph); // delete the edges for (edge_t edge : edges_to_delete) {