Call the registered exit functions if the dll is unloaded.
[reactos.git] / reactos / lib / msvcrt / dllmain.c
index 58b41c7..4a837a1 100644 (file)
@@ -37,6 +37,7 @@ extern BOOL __fileno_init(void);
 extern int BlockEnvToEnvironA(void);
 extern int BlockEnvToEnvironW(void);
 extern void FreeEnvironment(char **environment);
+extern void _atexit_cleanup(void);
 
 extern unsigned int _osver;
 extern unsigned int _winminor;
@@ -116,6 +117,7 @@ DllMain(PVOID hinstDll, ULONG dwReason, PVOID reserved)
         //DPRINT("Detach\n");
         /* FIXME: more cleanup... */
         _fcloseall();
+        _atexit_cleanup();
 
         /* destroy tls stuff */
         DestroyThreadData();