From: mquinson Date: Fri, 9 Mar 2007 16:42:39 +0000 (+0000) Subject: Integrate xbt_context_init/exit to the regular module mecanism; free the xbt_binary_n... X-Git-Tag: v3.3~2131 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/573c7a5e13ac11e8e0444378bb8f88e5b200e0bc?hp=046ff6a2e730b43a41b781849c23f6adbb91c582 Integrate xbt_context_init/exit to the regular module mecanism; free the xbt_binary_name as late as possible since it can be used by module exit functions (if they do log) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3228 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index f443f17e6c..fff55bc218 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -37,6 +37,7 @@ xbt_init(int *argc, char **argv) { xbt_log_init(argc,argv); xbt_thread_mod_init(); + xbt_context_init(); } /** @brief Finalize the xbt mechanisms. */ @@ -44,11 +45,14 @@ void xbt_exit(){ xbt_initialized--; if (xbt_initialized == 0) { - free(xbt_binary_name); xbt_fifo_exit(); xbt_dict_exit(); + xbt_context_exit(); xbt_thread_mod_exit(); } xbt_log_exit(); + + if (xbt_initialized == 0) + free(xbt_binary_name); }