mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
FFI: Fix management of C library handles for default namespace.
This commit is contained in:
parent
5fe7282d4c
commit
54b6054087
@ -148,9 +148,13 @@ static void clib_unloadlib(CLibrary *cl)
|
|||||||
{
|
{
|
||||||
if (cl->handle == CLIB_DEFHANDLE) {
|
if (cl->handle == CLIB_DEFHANDLE) {
|
||||||
MSize i;
|
MSize i;
|
||||||
for (i = 0; i < CLIB_HANDLE_MAX; i++)
|
for (i = 0; i < CLIB_HANDLE_MAX; i++) {
|
||||||
if (clib_def_handle[i])
|
void *h = clib_def_handle[i];
|
||||||
FreeLibrary((HINSTANCE)clib_def_handle[i]);
|
if (h) {
|
||||||
|
clib_def_handle[i] = NULL;
|
||||||
|
FreeLibrary((HINSTANCE)h);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (!cl->handle) {
|
} else if (!cl->handle) {
|
||||||
FreeLibrary((HINSTANCE)cl->handle);
|
FreeLibrary((HINSTANCE)cl->handle);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user