# HG changeset patch # User ladanyi # Date 1132655245 0 # Node ID 535d2eccfc038701b9edc3f13e9fc868756556d7 # Parent 3a15b39a7c781fa52bcc6a75accbf6e4daf3a47a fixed some memory leaks diff -r 3a15b39a7c78 -r 535d2eccfc03 gui/graph_displayer_canvas-edge.cc --- a/gui/graph_displayer_canvas-edge.cc Mon Nov 21 18:12:11 2005 +0000 +++ b/gui/graph_displayer_canvas-edge.cc Tue Nov 22 10:27:25 2005 +0000 @@ -4,18 +4,17 @@ int GraphDisplayerCanvas::resetEdgeWidth (Edge edge) { - Graph::EdgeMap * actual_map; double min, max; min=edge_property_defaults[E_WIDTH]; max=edge_property_defaults[E_WIDTH]; - actual_map=new Graph::EdgeMap(mapstorage.graph,edge_property_defaults[E_WIDTH]); + Graph::EdgeMap actual_map(mapstorage.graph,edge_property_defaults[E_WIDTH]); if(edge==INVALID) { for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i) { - double v=fabs((*actual_map)[i]); + double v=fabs(actual_map[i]); int w; if(min==max) { @@ -30,7 +29,7 @@ } else { - int w=(int)(*actual_map)[edge]; + int w=(int)actual_map[edge]; if(w>=0) { edgesmap[edge]->property_width_units().set_value(w); @@ -135,8 +134,7 @@ //function maps the range of the maximum and //the minimum of the nodemap to the range of //green in RGB - Graph::EdgeMap * actual_map; - actual_map=new Graph::EdgeMap(mapstorage.graph,edge_property_defaults[E_COLOR]); + Graph::EdgeMap actual_map(mapstorage.graph,edge_property_defaults[E_COLOR]); double max, min; @@ -147,7 +145,7 @@ { for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i) { - double w=(*actual_map)[i]; + double w=actual_map[i]; Gdk::Color color; if(max!=min) @@ -165,7 +163,7 @@ { Gdk::Color color; - double w=(*actual_map)[edge]; + double w=actual_map[edge]; if(max!=min) { diff -r 3a15b39a7c78 -r 535d2eccfc03 gui/graph_displayer_canvas-node.cc --- a/gui/graph_displayer_canvas-node.cc Mon Nov 21 18:12:11 2005 +0000 +++ b/gui/graph_displayer_canvas-node.cc Tue Nov 22 10:27:25 2005 +0000 @@ -61,17 +61,16 @@ int GraphDisplayerCanvas::resetNodeRadius (Node node) { - Graph::NodeMap * actual_map; double min, max; min=node_property_defaults[N_RADIUS]; max=node_property_defaults[N_RADIUS]; - actual_map=new Graph::NodeMap(mapstorage.graph,node_property_defaults[N_RADIUS]); + Graph::NodeMap actual_map(mapstorage.graph,node_property_defaults[N_RADIUS]); if(node==INVALID) { for (NodeIt i(mapstorage.graph); i!=INVALID; ++i) { - double v=fabs((*actual_map)[i]); + double v=fabs(actual_map[i]); int w; if(min==max) { @@ -98,7 +97,7 @@ else { //I think only new nodes use this case -// int w=(int)(*actual_map)[node]; +// int w=(int)actual_map[node]; int w=(int)(node_property_defaults[N_RADIUS]); if(w>=0) { @@ -179,8 +178,7 @@ //the minimum of the nodemap to the range of //green in RGB - Graph::NodeMap * actual_map; - actual_map=new Graph::NodeMap(mapstorage.graph,node_property_defaults[N_COLOR]); + Graph::NodeMap actual_map(mapstorage.graph,node_property_defaults[N_COLOR]); double max, min; @@ -194,7 +192,7 @@ { Gdk::Color color; - double w=(*actual_map)[i]; + double w=actual_map[i]; if(max!=min) { @@ -212,7 +210,7 @@ { Gdk::Color color; - double w=(*actual_map)[node]; + double w=actual_map[node]; if(max!=min) {