NetBSD/gnu/dist/libio/cleanup.c
mycroft 913449a520 Disable the atexit(_IO_cleanup) for two good reasons:
1) There is already a destructor that does this.  The atexit() is superfluous.
2) If libstdc++ is loaded dynamically by dlopen() and then is removed by
   dlclose(), the pointer is no longer valid and the program would core dump
   at exit() time.  (This caused xmms to core dump at exit when xmms-sid was
   installed, for example.)
NOTE: THIS NEEDS TO BE APPLIED TO THE `TOOLCHAIN' VERSION.
2001-12-24 16:38:19 +00:00

18 lines
368 B
C

#include "libioP.h"
#if _G_HAVE_ATEXIT && 0
#include <stdlib.h>
typedef void (*voidfunc) __P((void));
static void
_IO_register_cleanup ()
{
atexit ((voidfunc)_IO_cleanup);
_IO_cleanup_registration_needed = 0;
}
void (*_IO_cleanup_registration_needed)() = _IO_register_cleanup;
#else
void (*_IO_cleanup_registration_needed)() = NULL;
#endif /* _G_HAVE_ATEXIT */