Bug fix
authordeba
Tue, 09 May 2006 11:25:34 +0000
changeset 2074c7ee2a2a3cff
parent 2073 d886e4b131e6
child 2075 d4d1f6ca5c23
Bug fix

Do not delete the not constructed map
lemon/bellman_ford.h
     1.1 --- a/lemon/bellman_ford.h	Tue May 09 09:23:39 2006 +0000
     1.2 +++ b/lemon/bellman_ford.h	Tue May 09 11:25:34 2006 +0000
     1.3 @@ -326,13 +326,13 @@
     1.4      BellmanFord(const Graph& _graph, const LengthMap& _length) :
     1.5        graph(&_graph), length(&_length),
     1.6        _pred(0), local_pred(false),
     1.7 -      _dist(0), local_dist(false) {}
     1.8 +      _dist(0), local_dist(false), _mask(0) {}
     1.9      
    1.10      ///Destructor.
    1.11      ~BellmanFord() {
    1.12        if(local_pred) delete _pred;
    1.13        if(local_dist) delete _dist;
    1.14 -      delete _mask;
    1.15 +      if(_mask) delete _mask;
    1.16      }
    1.17  
    1.18      /// \brief Sets the length map.