diff options
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r-- | winsup/cygwin/dll_init.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index c3059ac..8d5f34c 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -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 *); @@ -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) |