diff options
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r-- | winsup/cygwin/dll_init.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index d4dcca0e9..5a5b165dc 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -1,6 +1,6 @@ /* dll_init.cc - Copyright 1998, 1999, 2000, 2001 Red Hat, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for @@ -8,7 +8,7 @@ details. */ #include "winsup.h" #include <stdlib.h> -#include "exceptions.h" +#include <errno.h> #include "cygerrno.h" #include "perprocess.h" #include "dll_init.h" @@ -18,6 +18,7 @@ details. */ #include "path.h" #include "dtable.h" #include "cygheap.h" +#include "pinfo.h" extern void __stdcall check_sanity_and_sync (per_process *); @@ -97,7 +98,7 @@ dll_list::operator[] (const char *name) return NULL; } -#define RETRIES 100 +#define RETRIES 1000 /* Allocate space for a dll struct contiguous with the just-loaded dll. */ dll * @@ -183,6 +184,9 @@ dll_list::alloc (HINSTANCE h, per_process *p, dll_type type) void dll_list::detach (dll *d) { + if (!myself || myself->process_state == PID_EXITED) + return; + if (d->count <= 0) system_printf ("WARNING: try to detach an already detached dll ...\n"); else if (--d->count == 0) @@ -203,7 +207,6 @@ dll_list::detach (dll *d) void dll_list::init () { - debug_printf ("here"); /* Make sure that destructors are called on exit. */ if (!dll_global_dtors_recorded) { |