diff options
author | Christopher Faylor <me@cgf.cx> | 2010-03-28 17:27:52 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-03-28 17:27:52 +0000 |
commit | c019a66c32f8575c85524e4fb889d79093acee56 (patch) | |
tree | 278a080d1137888fb71c7d1d9e8b6719aeffaf26 /winsup | |
parent | 84fef941e8d447e5b85db7ab4616b69d176bdcc2 (diff) | |
download | cygnal-c019a66c32f8575c85524e4fb889d79093acee56.tar.gz cygnal-c019a66c32f8575c85524e4fb889d79093acee56.tar.bz2 cygnal-c019a66c32f8575c85524e4fb889d79093acee56.zip |
* globals.cc (exit_status): Add new ES_EXIT_STARTING enum.
* dcrt0.cc (cygwin_exit): Set exit_state to ES_EXIT_STARTING prior to calling
real exit.
* dll_init.cc (dll_list::detach): Remove dll from linked list and call
destructors even if exiting. Don't call __cxa_finalize in exiting case.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/dll_init.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/globals.cc | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d695f4b7b..66f84a415 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2010-03-28 Christopher Faylor <me+cygwin@cgf.cx> + + * globals.cc (exit_status): Add new ES_EXIT_STARTING enum. + * dcrt0.cc (cygwin_exit): Set exit_state to ES_EXIT_STARTING prior to + calling real exit. + * dll_init.cc (dll_list::detach): Remove dll from linked list and call + destructors even if exiting. Don't call __cxa_finalize in exiting case. + 2010-03-27 Corinna Vinschen <corinna@vinschen.de> * nlsfuncs.cc (__set_charset_from_locale): Set default charset for diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 6a1a341aa..76b89517b 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -1127,6 +1127,7 @@ cygwin_atexit (void (*fn) (void)) extern "C" void cygwin_exit (int n) { + exit_state = ES_EXIT_STARTING; exit (n); } diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index bd3d7d996..24d6d5c5f 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -164,7 +164,7 @@ void dll_list::detach (void *retaddr) { dll *d; - if (!myself || exit_state || !(d = find (retaddr))) + if (!myself || !(d = find (retaddr))) return; if (d->count <= 0) system_printf ("WARNING: trying to detach an already detached dll ..."); @@ -172,7 +172,9 @@ dll_list::detach (void *retaddr) { /* Ensure our exception handler is enabled for destructors */ exception protect; - __cxa_finalize (d); + /* Call finalize function if we are not already exiting */ + if (!exit_state) + __cxa_finalize (d); d->run_dtors (); d->prev->next = d->next; if (d->next) diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index 5934a72b7..0baa96e3a 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -30,6 +30,7 @@ int NO_COPY sigExeced; enum exit_states { ES_NOT_EXITING = 0, + ES_EXIT_STARTING, ES_PROCESS_LOCKED, ES_EVENTS_TERMINATE, ES_THREADTERM, |