Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "Argh stupid me! This fixes commit 4fff3fb509f60c96745fb5d3e1be1bd824185366...
[simgrid.git] / src / xbt / xbt_main.c
index 773e3c5..59b050c 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "xbt_modinter.h"       /* prototype of other module's init/exit in XBT */
 
+#include "simgrid/sg_config.h"
+
 XBT_LOG_NEW_CATEGORY(xbt, "All XBT categories (simgrid toolbox)");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
 
@@ -90,11 +92,11 @@ static void xbt_preinit(void) {
   srand(seed);
   srand48(seed);
 
-  atexit(xbt_postexit);   
 }
 
 static void xbt_postexit(void)
 {
+  if(!sg_cfg_get_boolean("clean_atexit")) return;
   xbt_backtrace_postexit();
   xbt_fifo_postexit();
   xbt_dict_postexit();