Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug some more memleaks. aint bad anymore
[simgrid.git] / src / surf / network_im.c
index 48447e1..9b4ef5b 100644 (file)
@@ -605,12 +605,13 @@ static surf_action_t im_net_communicate(const char *src_name,
 
   xbt_dynar_t back_route = NULL;
   int constraints_per_variable = 0;
-  // I will need this route for some time so let's call get_route_no_cleanup
-  xbt_dynar_t route = global_routing->get_route_no_cleanup(src_name, dst_name);
+  // I need to have the forward and backward routes at the same time, so allocate "route". That way, the routing wont clean it up
+  xbt_dynar_t route=xbt_dynar_new(global_routing->size_of_link,NULL);
+  routing_get_route_and_latency(src_name, dst_name,&route,NULL);
 
 
   if (sg_network_fullduplex == 1) {
-    back_route = routing_get_route(dst_name, src_name);
+    routing_get_route_and_latency(dst_name, src_name, &back_route, NULL);
   }
 
   /* LARGE PLATFORMS HACK:
@@ -747,7 +748,9 @@ static surf_action_t im_net_communicate(const char *src_name,
 
 static xbt_dynar_t im_net_get_route(const char *src, const char *dst)
 {
-  return routing_get_route(src, dst);
+  xbt_dynar_t route=NULL;
+  routing_get_route_and_latency(src, dst,&route,NULL);
+  return route;
 }
 
 static double im_net_get_link_bandwidth(const void *link)