COIN-OR::LEMON - Graph Library

Changeset 1825:535d2eccfc03 in lemon-0.x


Ignore:
Timestamp:
11/22/05 11:27:25 (18 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2375
Message:

fixed some memory leaks

Location:
gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gui/graph_displayer_canvas-edge.cc

    r1819 r1825  
    55int GraphDisplayerCanvas::resetEdgeWidth (Edge edge)
    66{
    7   Graph::EdgeMap<double> * actual_map;
    87  double min, max;
    98
    109  min=edge_property_defaults[E_WIDTH];
    1110  max=edge_property_defaults[E_WIDTH];
    12   actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_WIDTH]);
     11  Graph::EdgeMap<double> actual_map(mapstorage.graph,edge_property_defaults[E_WIDTH]);
    1312 
    1413  if(edge==INVALID)
     
    1615      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
    1716        {
    18           double v=fabs((*actual_map)[i]);
     17          double v=fabs(actual_map[i]);
    1918          int w;
    2019          if(min==max)
     
    3130  else
    3231    {
    33       int w=(int)(*actual_map)[edge];
     32      int w=(int)actual_map[edge];
    3433      if(w>=0)
    3534        {
     
    136135  //the minimum of the nodemap to the range of
    137136  //green in RGB
    138   Graph::EdgeMap<double> * actual_map;
    139   actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_COLOR]);
     137  Graph::EdgeMap<double> actual_map(mapstorage.graph,edge_property_defaults[E_COLOR]);
    140138
    141139  double max, min;
     
    148146      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
    149147        {
    150           double w=(*actual_map)[i];
     148          double w=actual_map[i];
    151149
    152150          Gdk::Color color;
     
    166164      Gdk::Color color;
    167165
    168       double w=(*actual_map)[edge];
     166      double w=actual_map[edge];
    169167
    170168      if(max!=min)
  • gui/graph_displayer_canvas-node.cc

    r1819 r1825  
    6262int GraphDisplayerCanvas::resetNodeRadius (Node node)
    6363{
    64   Graph::NodeMap<double> * actual_map;
    6564  double min, max;
    6665  min=node_property_defaults[N_RADIUS];
    6766  max=node_property_defaults[N_RADIUS];
    68   actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_RADIUS]);
     67  Graph::NodeMap<double> actual_map(mapstorage.graph,node_property_defaults[N_RADIUS]);
    6968 
    7069  if(node==INVALID)
     
    7271      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
    7372        {
    74           double v=fabs((*actual_map)[i]);
     73          double v=fabs(actual_map[i]);
    7574          int w;
    7675          if(min==max)
     
    9998    {
    10099      //I think only new nodes use this case
    101 //       int w=(int)(*actual_map)[node];
     100//       int w=(int)actual_map[node];
    102101      int w=(int)(node_property_defaults[N_RADIUS]);
    103102      if(w>=0)
     
    180179  //green in RGB
    181180
    182   Graph::NodeMap<double> * actual_map;
    183   actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_COLOR]);
     181  Graph::NodeMap<double> actual_map(mapstorage.graph,node_property_defaults[N_COLOR]);
    184182
    185183  double max, min;
     
    195193          Gdk::Color color;
    196194
    197           double w=(*actual_map)[i];
     195          double w=actual_map[i];
    198196
    199197          if(max!=min)
     
    213211      Gdk::Color color;
    214212
    215       double w=(*actual_map)[node];
     213      double w=actual_map[node];
    216214
    217215      if(max!=min)
Note: See TracChangeset for help on using the changeset viewer.