* 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.
This commit is contained in:
Christopher Faylor
2008-07-27 14:52:46 +00:00
parent bfd2b1c930
commit 904413e731
4 changed files with 22 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ details. */
#include "winsup.h"
#include "cygtls.h"
#include "ntdll.h"
#include "shared_info.h"
static DWORD _my_oldfunc;
@@ -142,6 +143,8 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
_my_oldfunc = TlsAlloc ();
break;
case DLL_PROCESS_DETACH:
if (dynamically_loaded)
shared_destroy ();
break;
case DLL_THREAD_ATTACH:
if (hwait_sig)