diff options
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r-- | winsup/cygwin/dll_init.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index e5e650fa9..4ff740cc4 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -59,6 +59,11 @@ void per_module::run_dtors () { void (**pfunc)() = dtors; + + if( dtors_run ) + return; + dtors_run = true; + for (int i = 1; pfunc[i]; i++) (pfunc[i]) (); } @@ -72,6 +77,8 @@ dll::init () /* Why didn't we just import this variable? */ *(p.envptr) = __cygwin_environ; + p.dtors_run = false; + /* Don't run constructors or the "main" if we've forked. */ if (!in_forkee) { |