Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Various cleanups+allow cross-compilation with gcc
[simgrid.git] / src / xbt / xbt_main.c
index 7ae8e49..bba945c 100644 (file)
@@ -35,7 +35,10 @@ xbt_init(int *argc, char **argv) {
   srand((unsigned int)time(NULL));
   VERB0("Initialize XBT");
   
+  xbt_backtrace_init();
   xbt_log_init(argc,argv);
+  xbt_os_thread_mod_init();
+  xbt_context_mod_init();
 }
 
 /** @brief Finalize the xbt mechanisms. */
@@ -43,10 +46,15 @@ void
 xbt_exit(){
   xbt_initialized--;
   if (xbt_initialized == 0) {
-    free(xbt_binary_name);
     xbt_fifo_exit();
     xbt_dict_exit();
+    xbt_context_mod_exit();
+    xbt_os_thread_mod_exit();
+    xbt_log_exit();
+    xbt_backtrace_exit();
   }
-  xbt_log_exit();
+   
+  if (xbt_initialized == 0)
+    free(xbt_binary_name);
 }