# HG changeset patch # User ladanyi # Date 1132655245 0 # Node ID 55cf06f149810e57cf1bacb1504a23a2320351b5 # Parent e9f8f44f12a345714b9236d4f876f0eb10e39e42 fixed some memory leaks diff -r e9f8f44f12a3 -r 55cf06f14981 graph_displayer_canvas-edge.cc --- a/graph_displayer_canvas-edge.cc Mon Nov 21 18:03:20 2005 +0000 +++ b/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 e9f8f44f12a3 -r 55cf06f14981 graph_displayer_canvas-node.cc --- a/graph_displayer_canvas-node.cc Mon Nov 21 18:03:20 2005 +0000 +++ b/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) {