From e7fd08839efe218e3ee557e3061c9fd995bbe982 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 5 Feb 2010 15:05:22 +0000 Subject: [PATCH] * dll_init.cc (per_module::run_dtors): Use consistent method for running destructors. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/dll_init.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4b26c9aee..815b2e338 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2010-02-05 Christopher Faylor + + * dll_init.cc (per_module::run_dtors): Use consistent method for + running destructors. + 2010-02-04 Christopher Faylor * regcomp.c (p_ere): Workaround incorrect compiler warning. diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index e449f7777..055b1060f 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -63,8 +63,8 @@ void per_module::run_dtors () { void (**pfunc)() = dtors; - for (int i = 1; pfunc[i]; i++) - (pfunc[i]) (); + while (*++pfunc) + (*pfunc) (); } /* Initialize an individual DLL */