# HG changeset patch # User marci # Date 1081187791 0 # Node ID 50f1d2077d50f221b13a8d198e1fd0f55962cf64 # Parent 379e1d50089d71cf12dcc73c2e975ed4d38dfd21 . diff -r 379e1d50089d -r 50f1d2077d50 src/work/list_graph.h --- a/src/work/list_graph.h Mon Apr 05 17:44:00 2004 +0000 +++ b/src/work/list_graph.h Mon Apr 05 17:56:31 2004 +0000 @@ -233,7 +233,9 @@ ListGraph() : node_id(0), edge_id(0), _node_num(0), _edge_num(0), _first_node(0), _last_node(0) { } ~ListGraph() { - while (first().valid()) erase(first()); + NodeIt n; + while (this->valid(first(n))) erase(n); + //while (first().valid()) erase(first()); } int nodeNum() const { return _node_num; } @@ -334,8 +336,16 @@ } void erase(Node i) { - while (first(i).valid()) erase(first(i)); - while (first(i).valid()) erase(first(i)); + { + OutEdgeIt e; + while (this->valid(first(e, i))) erase(e); + } + { + InEdgeIt e; + while (this->valid(first(e, i))) erase(e); + } + //while (first(i).valid()) erase(first(i)); + //while (first(i).valid()) erase(first(i)); _delete_node(i.node); }