aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dlfcn.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dlfcn.c b/src/dlfcn.c
index cb9f9bb..be6e01f 100644
--- a/src/dlfcn.c
+++ b/src/dlfcn.c
@@ -466,6 +466,10 @@ int dlclose( void *handle )
466 466
467 error_occurred = FALSE; 467 error_occurred = FALSE;
468 468
469 /* dlopen(NULL, ...) does not call LoadLibrary(), so do not call FreeLibrary(). */
470 if( hModule == GetModuleHandle( NULL ) )
471 return 0;
472
469 ret = FreeLibrary( hModule ); 473 ret = FreeLibrary( hModule );
470 474
471 /* If the object was loaded with RTLD_LOCAL, remove it from list of local 475 /* If the object was loaded with RTLD_LOCAL, remove it from list of local