From: navarrop Date: Thu, 10 Mar 2011 13:01:17 +0000 (+0000) Subject: Free dict random_value and patterns after the end of the platform. X-Git-Tag: v3.6_beta2~184 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1553fe73cf3bb8904cb71df4233b029cf8f6b485 Free dict random_value and patterns after the end of the platform. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9776 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 4fb63a470f..ceaf59bbba 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -74,6 +74,7 @@ static void routing_parse_Sconfig(void); /*config Tag */ static void routing_parse_Econfig(void); /*config Tag */ static char* replace_random_parameter(char * chaine); +static void clean_dict_random(void); /* this lines are only for replace use like index in the model table */ typedef enum { @@ -1134,6 +1135,8 @@ void routing_model_create(size_t size_of_links, void *loopback, double_f_cpvoid_ surfxml_add_callback(STag_surfxml_peer_cb_list, &routing_parse_Speer); + surfxml_add_callback(ETag_surfxml_platform_cb_list, + &clean_dict_random); #ifdef HAVE_TRACING instr_routing_define_callbacks(); @@ -3729,10 +3732,18 @@ static char* replace_random_parameter(char * string) xbt_free(string); string = test_string; } //In other case take old value (without ${}) - + else + free(test_string); return string; } +static void clean_dict_random(void) +{ + XBT_DEBUG("Clean dict for random"); + xbt_dict_free(&random_value); + xbt_dict_free(&patterns); +} + static void routing_parse_Speer(void) { static int AX_ptr = 0;