diff --git a/deps/libbdsg b/deps/libbdsg index 6b871a5a2e8..757896a678e 160000 --- a/deps/libbdsg +++ b/deps/libbdsg @@ -1 +1 @@ -Subproject commit 6b871a5a2e8367b97f09f81d59d7d192cff0caa1 +Subproject commit 757896a678eb7af7215147ef38cdb9315775dfe0 diff --git a/deps/libhandlegraph b/deps/libhandlegraph index 8bb58a35014..ccc11459019 160000 --- a/deps/libhandlegraph +++ b/deps/libhandlegraph @@ -1 +1 @@ -Subproject commit 8bb58a3501424ca2876287e383cd650a98608c41 +Subproject commit ccc11459019680ae53b65bcc19077d41ecff3075 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) { diff --git a/src/subcommand/paths_main.cpp b/src/subcommand/paths_main.cpp index 1fc293df752..d6dd1f4adf8 100644 --- a/src/subcommand/paths_main.cpp +++ b/src/subcommand/paths_main.cpp @@ -578,21 +578,17 @@ int main_paths(int argc, char** argv) { exit(1); } - vector to_destroy; + vector to_destroy; if (drop_paths) { for_each_selected_path([&](const path_handle_t& path_handle) { - string name = graph->get_path_name(path_handle); - to_destroy.push_back(name); + to_destroy.push_back(path_handle); }); } else { for_each_unselected_path([&](const path_handle_t& path_handle) { - string name = graph->get_path_name(path_handle); - to_destroy.push_back(name); + to_destroy.push_back(path_handle); }); } - for (string& path_name : to_destroy) { - mutable_graph->destroy_path(graph->get_path_handle(path_name)); - } + mutable_graph->destroy_paths(to_destroy); // output the graph serializable_graph->serialize(cout);