From 3ac78fd61216d2a388aaec9362ac99c934bf725a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 11 May 2005 21:53:54 +0000 Subject: [PATCH] * dcrt0.cc (do_global_dtors): Don't call dll_global_dtors here. (__main): Reinstate atexit of do_global_dtors. (cygwin_exit): Call dll_global_dtors here. (do_exit): And here. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/dcrt0.cc | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 377747ee5..6419c9084 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2005-05-11 Christopher Faylor + + * dcrt0.cc (do_global_dtors): Don't call dll_global_dtors here. + (__main): Reinstate atexit of do_global_dtors. + (cygwin_exit): Call dll_global_dtors here. + (do_exit): And here. + + 2005-05-10 Christopher Faylor * cygtls.cc (_cygtls::remove): Clear exitsock after close. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index a29722968..f211e4578 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -129,9 +129,8 @@ char *old_title; char title_buf[TITLESIZE + 1]; static void -do_global_dtors (void) +do_global_dtors () { - dll_global_dtors (); void (**pfunc) () = user_data->dtors; if (pfunc) { @@ -982,6 +981,7 @@ extern "C" void __main (void) { do_global_ctors (user_data->ctors, false); + atexit (do_global_dtors); } exit_states NO_COPY exit_state; @@ -1003,7 +1003,7 @@ do_exit (int status) EnterCriticalSection (&exit_lock); muto::set_exiting_thread (); - do_global_dtors (); + dll_global_dtors (); if (exit_state < ES_EVENTS_TERMINATE) { @@ -1107,7 +1107,7 @@ cygwin_atexit (void (*function)(void)) extern "C" void cygwin_exit (int n) { - do_global_dtors (); + dll_global_dtors (); if (atexit_lock) atexit_lock.acquire (); exit (n);