* dlfcn.cc (dlclose): Do not call FreeLibrary if the symbol to close was

obtained by dlopen(NULL,...).
This commit is contained in:
Christopher Faylor 2001-06-03 14:13:12 +00:00
parent 77d130214c
commit aa7a61121e
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sun Jun 3 09:49:55 2001 Robert Collins <rbtcollins@hotmail.com>
* dlfcn.cc (dlclose): Do not call FreeLibrary if the symbol to close
was obtained by dlopen(NULL,...).
Sat Jun 2 23:11:52 2001 Christopher Faylor <cgf@cygnus.com>
* syscalls.cc (sleep): Try to be a little more accomodating of signal

View File

@ -129,10 +129,12 @@ dlclose (void *handle)
SetResourceLock(LOCK_DLL_LIST,READ_LOCK|WRITE_LOCK," dlclose");
int ret = -1;
if (FreeLibrary ((HMODULE) handle))
void *temphandle = (void *) GetModuleHandle (NULL);
if (temphandle == handle || FreeLibrary ((HMODULE) handle))
ret = 0;
if (ret)
set_dl_error ("dlclose");
CloseHandle ((HMODULE) temphandle);
ReleaseResourceLock(LOCK_DLL_LIST,READ_LOCK|WRITE_LOCK," dlclose");
return ret;