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:
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r--winsup/cygwin/dll_init.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index c3059ac40..8d5f34ca7 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)