# HG changeset patch # User alpar # Date 1118310471 0 # Node ID be025fc1b13df64a92e55f2dc19f29e46205e613 # Parent 5289afbdb7201b7e1238c64954ba64cd1f330666 Serious bugfix in ListGraph::SnapShot and SmartGraph::SnapShot diff -r 5289afbdb720 -r be025fc1b13d lemon/list_graph.h --- a/lemon/list_graph.h Thu Jun 09 09:46:34 2005 +0000 +++ b/lemon/list_graph.h Thu Jun 09 09:47:51 2005 +0000 @@ -457,6 +457,13 @@ exit(1); } + ///\bug What is this used for? + /// + virtual void build() {} + ///\bug What is this used for? + /// + virtual void clear() {} + void regist(ListGraph &_g) { g=&_g; AlterationNotifier::ObserverBase:: @@ -517,13 +524,14 @@ /// ///\todo This function might be called undo(). void restore() { + ListGraph &old_g=*g; deregist(); while(!added_edges.empty()) { - g->erase(added_edges.front()); + old_g.erase(added_edges.front()); added_edges.pop_front(); } while(!added_nodes.empty()) { - g->erase(added_nodes.front()); + old_g.erase(added_nodes.front()); added_nodes.pop_front(); } } diff -r 5289afbdb720 -r be025fc1b13d lemon/smart_graph.h --- a/lemon/smart_graph.h Thu Jun 09 09:46:34 2005 +0000 +++ b/lemon/smart_graph.h Thu Jun 09 09:47:51 2005 +0000 @@ -280,14 +280,14 @@ protected: void restoreSnapShot(const SnapShot &s) { - while(s.edge_num>edges.size()) { + while(s.edge_numnodes.size()) { + while(s.node_num