From 573c7a5e13ac11e8e0444378bb8f88e5b200e0bc Mon Sep 17 00:00:00 2001 From: mquinson Date: Fri, 9 Mar 2007 16:42:39 +0000 Subject: [PATCH 1/1] 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 --- src/xbt/xbt_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- 2.20.1