X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/32b5b8b24e805a651ffc567bc7da748f49467f0a..4f11d2862f6367e7ddb2892df275cad235a93c02:/src/xbt/xbt_main.c diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index f6f079cc8b..fff55bc218 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -23,14 +23,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module,xbt, "module handling"); char *xbt_binary_name=NULL; /* Mandatory to retrieve neat backtraces */ int xbt_initialized=0; -struct xbt_module_ { - xbt_dynar_t *deps; - xbt_cfg_t *cfg; - int ref; - xbt_module_new_fct_t new; - xbt_module_finalize_fct_t finalize; -}; - /** @brief Initialize the xbt mechanisms. */ void xbt_init(int *argc, char **argv) { @@ -39,19 +31,28 @@ xbt_init(int *argc, char **argv) { if (xbt_initialized!=1) return; - xbt_binary_name = strdup(argv[0]); + xbt_binary_name = xbt_strdup(argv[0]); srand((unsigned int)time(NULL)); VERB0("Initialize XBT"); xbt_log_init(argc,argv); + xbt_thread_mod_init(); + xbt_context_init(); } /** @brief Finalize the xbt mechanisms. */ void xbt_exit(){ xbt_initialized--; - if (xbt_initialized == 0) - free(xbt_binary_name); + if (xbt_initialized == 0) { + xbt_fifo_exit(); + xbt_dict_exit(); + xbt_context_exit(); + xbt_thread_mod_exit(); + } xbt_log_exit(); + + if (xbt_initialized == 0) + free(xbt_binary_name); }