Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2009-08-22 01:32:06 +0400
committerChristopher Faylor <me@cgf.cx>2009-08-22 01:32:06 +0400
commit6282fe16ddf562366d87d7e23ba3b63413cb0218 (patch)
treed007b9daa192e004c18c86cb5185df3c12fd8f9d /winsup/cygwin/dll_init.h
parente41f43a1a675ee6d0f21f2ab611c97ffe9c22088 (diff)
* dll_init.h (has_dtors): New flag.
(run_dtors): New wrapper function which avoids calling dtors more than once. * dll_init.cc (dll_global_dtors): Use dll.run_dtors wrapper. (dll_list::detach): Ditto. (dll_list::alloc): Set has_dtors flag.
Diffstat (limited to 'winsup/cygwin/dll_init.h')
-rw-r--r--winsup/cygwin/dll_init.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h
index 9a712a3cc..90cfa03e2 100644
--- a/winsup/cygwin/dll_init.h
+++ b/winsup/cygwin/dll_init.h
@@ -50,10 +50,19 @@ struct dll
per_module p;
HMODULE handle;
int count;
+ bool has_dtors;
dll_type type;
WCHAR name[1];
void detach ();
int init ();
+ void run_dtors ()
+ {
+ if (has_dtors)
+ {
+ has_dtors = 0;
+ p.run_dtors ();
+ }
+ }
};
#define MAX_DLL_BEFORE_INIT 100