From: Arnaud Giersch Date: Tue, 2 Oct 2012 08:45:18 +0000 (+0200) Subject: Use atexit to call xbt_postexit. X-Git-Tag: v3_8~146^2~5^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1135b9073122e9e978cdbfec9751b5c5cedd5a67?hp=3a4b0619b7ea56a08980be9a7c40c9a535f82e73 Use atexit to call xbt_postexit. --- diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index 030dd348c4..1dae308773 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -37,7 +37,7 @@ char* _surf_mc_property_file=NULL; * This is crude and rather compiler-specific, unfortunately. */ static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200); -static void xbt_postexit(void) _XBT_GNUC_DESTRUCTOR(200); +static void xbt_postexit(void); #ifdef _XBT_WIN32 # undef _XBT_NEED_INIT_PRAGMA @@ -45,7 +45,6 @@ static void xbt_postexit(void) _XBT_GNUC_DESTRUCTOR(200); #ifdef _XBT_NEED_INIT_PRAGMA #pragma init (xbt_preinit) -#pragma fini (xbt_postexit) #endif #ifdef _XBT_WIN32 @@ -73,7 +72,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, } else if (fdwReason == DLL_PROCESS_DETACH && xbt_dll_process_is_attached == 1) { xbt_dll_process_is_attached = 0; - xbt_postexit(); } return 1; } @@ -94,6 +92,8 @@ static void xbt_preinit(void) xbt_dict_preinit(); xbt_datadesc_preinit(); xbt_trp_preinit(); + + atexit(xbt_postexit); } static void xbt_postexit(void)