X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b3677b425b9cc6949c1573d59ac772540cbf4b2..6211c588d514efac018d071c4304df3f7bace3bd:/src/surf/surf_routing_full.cpp diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index 4c0aeb0359..980221ef58 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -54,17 +54,19 @@ AsFull::AsFull(){ } AsFull::~AsFull(){ - int table_size = (int)xbt_dynar_length(p_indexNetworkElm); - int i, j; - /* Delete routing table */ - for (i = 0; i < table_size; i++) - for (j = 0; j < table_size; j++) { - if (TO_ROUTE_FULL(i,j)){ - xbt_dynar_free(&TO_ROUTE_FULL(i,j)->link_list); - xbt_free(TO_ROUTE_FULL(i,j)); + if (p_routingTable) { + int table_size = (int)xbt_dynar_length(p_indexNetworkElm); + int i, j; + /* Delete routing table */ + for (i = 0; i < table_size; i++) + for (j = 0; j < table_size; j++) { + if (TO_ROUTE_FULL(i,j)){ + xbt_dynar_free(&TO_ROUTE_FULL(i,j)->link_list); + xbt_free(TO_ROUTE_FULL(i,j)); + } } - } - xbt_free(p_routingTable); + xbt_free(p_routingTable); + } } xbt_dynar_t AsFull::getOneLinkRoutes() @@ -182,7 +184,7 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route) "between \"%s\" and \"%s\"", src, dst); } } else { - if (!route->gw_dst && !route->gw_dst) + if (!route->gw_src && !route->gw_dst) XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst); else { // FIXME We can call a gw which is down the current AS (cf g5k.xml) but not upper.