summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/shared.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-07-27 14:52:46 +0000
committerChristopher Faylor <me@cgf.cx>2008-07-27 14:52:46 +0000
commit904413e731347d5fd0e8356c3f79744eb3d977a4 (patch)
treedfda56c0bf0bfe3d28273c1de3c3b006e04e6cfb /winsup/cygwin/shared.cc
parentbfd2b1c9307ebe2cf8611b447cafa2809c9ac8dd (diff)
downloadcygnal-904413e731347d5fd0e8356c3f79744eb3d977a4.tar.gz
cygnal-904413e731347d5fd0e8356c3f79744eb3d977a4.tar.bz2
cygnal-904413e731347d5fd0e8356c3f79744eb3d977a4.zip
* shared_info.h (shared_destroy): Declare.
* shared.cc (shared_destroy): Define new function to destroy shared memory regions. * init.cc (dll_entry): Call shared_destroy when dll detaches from the process.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r--winsup/cygwin/shared.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index db24e71f1..23a8d992d 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -254,6 +254,15 @@ user_shared_initialize (bool reinit)
}
}
+void __stdcall
+shared_destroy ()
+{
+ ForceCloseHandle (cygwin_shared_h);
+ UnmapViewOfFile (cygwin_shared);
+ ForceCloseHandle (cygwin_user_h);
+ UnmapViewOfFile (user_shared);
+}
+
/* Use absolute path of cygwin1.dll to derive the Win32 dir which
is our installation root. Note that we can't handle Cygwin installation
root dirs of more than 4K path length. I assume that's ok... */