X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6de03ecc4e630732984a0673512a5d15fd75e270..8465282253954c58d16cb5dae9a5d064eada3329:/src/surf/surf_routing_floyd.cpp diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index f116c4e8cc..e87df4f4e7 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -33,22 +33,25 @@ AsFloyd::~AsFloyd(){ int i, j; int table_size; table_size = (int)xbt_dynar_length(p_indexNetworkElm); - /* Delete link_table */ - for (i = 0; i < table_size; i++) - for (j = 0; j < table_size; j++) - generic_free_route(TO_FLOYD_LINK(i, j)); - xbt_free(p_linkTable); - /* Delete bypass dict */ - xbt_dict_free(&p_bypassRoutes); - /* Delete predecessor and cost table */ - xbt_free(p_predecessorTable); - xbt_free(p_costTable); + if (p_linkTable == NULL) // Dealing with a parse error in the file? + return; + /* Delete link_table */ + for (i = 0; i < table_size; i++) + for (j = 0; j < table_size; j++) { + generic_free_route(TO_FLOYD_LINK(i, j)); + } + xbt_free(p_linkTable); + /* Delete bypass dict */ + xbt_dict_free(&p_bypassRoutes); + /* Delete predecessor and cost table */ + xbt_free(p_predecessorTable); + xbt_free(p_costTable); } /* Business methods */ xbt_dynar_t AsFloyd::getOneLinkRoutes() { - xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free); + xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f); sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1); route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL); @@ -177,9 +180,9 @@ void AsFloyd::parseRoute(sg_platf_route_cbarg_t route) XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src, route->gw_src->getName(), dst, route->gw_dst->getName()); if(route->gw_dst->getRcType() == SURF_NETWORK_ELEMENT_NULL) - xbt_die("The dst_gateway '%s' does not exist!",route->gw_dst->getName()); + surf_parse_error("The dst_gateway '%s' does not exist!",route->gw_dst->getName()); if(route->gw_src->getRcType() == SURF_NETWORK_ELEMENT_NULL) - xbt_die("The src_gateway '%s' does not exist!",route->gw_src->getName()); + surf_parse_error("The src_gateway '%s' does not exist!",route->gw_src->getName()); } if(TO_FLOYD_LINK(src_net_elm->getId(), dst_net_elm->getId()))