
Hi all, I have a vector of subgraphs and at certain situations I have to remove some vertex from one of them. As this is not possible for now, I simply create a temporary subgraph with the vertices I want and replace the old one. The problem is that the memory allocated from the old one is not freed correctly. What should be the correct procedure to do so?? a code snippet: void modgraph::remove_a_vertex(unsigned idx, Vertex vt) { Graph* temp_subg = &g.create_subgraph(); graph_traits < Graph >::vertex_iterator itg, end; for (tie(itg,end) = vertices(*subg(idx)); itg != end; ++itg) { if( (*subg(idx)).local_to_global(*itg) != vt ) { add_vertex(*itg, *temp_subg); } } *subg(idx) = *temp_subg; } where subg is a vector of subgraphs.