diff options
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r-- | winsup/cygwin/dll_init.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 9a867b5d8..dac48618a 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -31,7 +31,7 @@ dll_global_dtors () { int recorded = dll_global_dtors_recorded; dll_global_dtors_recorded = false; - if (recorded) + if (recorded && dlls.start.next) for (dll *d = dlls.end; d != &dlls.start; d = d->prev) d->p.run_dtors (); } @@ -217,10 +217,9 @@ dll_list::detach (void *retaddr) void dll_list::init () { - dll_global_dtors_recorded = true; - /* Walk the dll chain, initializing each dll */ dll *d = &start; + dll_global_dtors_recorded = d->next != NULL; while ((d = d->next)) d->init (); } |