OSDN Git Service

Changes suggested by Dave Korn.
authorcgf <cgf>
Mon, 4 Aug 2008 15:55:31 +0000 (15:55 +0000)
committercgf <cgf>
Mon, 4 Aug 2008 15:55:31 +0000 (15:55 +0000)
* dcrt0.cc (cygwin_exit): Remove (hopefully) extraneous call to
dll_global_dtors.
* dll_init.cc (dll_global_dtors): Run destructors in reverse dependency/load
order.
* dll_init.h (dll_list): Add dll_global_dtors as a friend.

winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/dll_init.cc
winsup/cygwin/dll_init.h

index e907245..32e9590 100644 (file)
@@ -1,3 +1,12 @@
+2008-08-04  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       Changes suggested by Dave Korn.
+       * dcrt0.cc (cygwin_exit): Remove (hopefully) extraneous call to
+       dll_global_dtors.
+       * dll_init.cc (dll_global_dtors): Run destructors in reverse
+       dependency/load order.
+       * dll_init.h (dll_list): Add dll_global_dtors as a friend.
+
 2008-08-01  Christopher Faylor  <me+cygwin@cgf.cx>
 
        * dcrt0.cc (dll_crt0_1): Add a symbol denoting return from call to
index e37cbec..dbdc61e 100644 (file)
@@ -1112,7 +1112,6 @@ cygwin_atexit (void (*function)(void))
 extern "C" void
 cygwin_exit (int n)
 {
-  dll_global_dtors ();
   if (atexit_lock)
     atexit_lock.acquire ();
   exit (n);
index 22c64e1..9a867b5 100644 (file)
@@ -32,7 +32,7 @@ dll_global_dtors ()
   int recorded = dll_global_dtors_recorded;
   dll_global_dtors_recorded = false;
   if (recorded)
-    for (dll *d = dlls.istart (DLL_ANY); d; d = dlls.inext ())
+    for (dll *d = dlls.end; d != &dlls.start; d = d->prev)
       d->p.run_dtors ();
 }
 
index 205123a..a7601e7 100644 (file)
@@ -86,6 +86,7 @@ public:
     hold = &start;
     return inext ();
   }
+  friend void dll_global_dtors ();
 };
 
 extern dll_list dlls;