diff options
author | Christopher Faylor <me@cgf.cx> | 2008-08-05 14:26:47 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2008-08-05 14:26:47 +0000 |
commit | 53364a1fae1574b2429827a03c55c36024348c3e (patch) | |
tree | ce892c63a30e6a8f5b0812eafe94c6a00ac9f05f | |
parent | bee18f45fd83bc2432a856b116e9b85b42c140d2 (diff) | |
download | cygnal-53364a1fae1574b2429827a03c55c36024348c3e.tar.gz cygnal-53364a1fae1574b2429827a03c55c36024348c3e.tar.bz2 cygnal-53364a1fae1574b2429827a03c55c36024348c3e.zip |
* dll_init.cc (dll_global_dtors): Add an additional test to avoid walking the
linked list if it is empty.
(dll_list::detach): Don't set dll_global_dtors_recorded if we aren't actually
going to record any dlls.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/dll_init.cc | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 32e9590b2..9e31b2a05 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2008-08-05 Christopher Faylor <me+cygwin@cgf.cx> + + * dll_init.cc (dll_global_dtors): Add an additional test to avoid + walking the linked list if it is empty. + (dll_list::detach): Don't set dll_global_dtors_recorded if we aren't + actually going to record any dlls. + 2008-08-04 Christopher Faylor <me+cygwin@cgf.cx> Changes suggested by Dave Korn. 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 (); } |