In exit and _cexit, call atexit routines. (Bug 3432_)

svn path=/trunk/; revision=34980
This commit is contained in:
Jeffrey Morlan 2008-07-31 17:46:50 +00:00
parent 41ad8e0c80
commit 173a8d6c7a

View file

@ -1,6 +1,8 @@
#include <precomp.h> #include <precomp.h>
#include <internal/atexit.h> #include <internal/atexit.h>
extern void _atexit_cleanup(void);
struct __atexit *__atexit_ptr = 0; struct __atexit *__atexit_ptr = 0;
/* /*
@ -18,6 +20,7 @@ void exit(int status)
*/ */
/* in case the program set it this way */ /* in case the program set it this way */
_setmode(0, O_TEXT); _setmode(0, O_TEXT);
_atexit_cleanup();
_exit(status); _exit(status);
for(;;); for(;;);
} }
@ -28,6 +31,7 @@ void exit(int status)
*/ */
void _exit(int _status) void _exit(int _status)
{ {
// FIXME: _exit and _c_exit should prevent atexit routines from being called during DLL unload
ExitProcess(_status); ExitProcess(_status);
for(;;); for(;;);
} }
@ -37,6 +41,7 @@ void _exit(int _status)
*/ */
void _cexit( void ) void _cexit( void )
{ {
_atexit_cleanup();
// flush // flush
} }
@ -45,5 +50,6 @@ void _cexit( void )
*/ */
void _c_exit( void ) void _c_exit( void )
{ {
// FIXME: _exit and _c_exit should prevent atexit routines from being called during DLL unload
// reset interup vectors // reset interup vectors
} }