about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibdl.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-03-09 14:10:09 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-03-09 14:10:09 +0100
commit33846405d8e0af86bb5cfb9dab4ea5026fadb614 (patch)
tree7fb9153caa2103fd0ec096472c542bcf4a4c6aea /src/wrapped/wrappedlibdl.c
parent378eb79ad3ec58b4c19b3b38845cdb8a5db8dc5d (diff)
downloadbox64-33846405d8e0af86bb5cfb9dab4ea5026fadb614.tar.gz
box64-33846405d8e0af86bb5cfb9dab4ea5026fadb614.zip
Improved unload of libs (help wine when dlopen / dlclose is supposed to unload the lib so it can be dlopen again)
Diffstat (limited to 'src/wrapped/wrappedlibdl.c')
-rw-r--r--src/wrapped/wrappedlibdl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wrapped/wrappedlibdl.c b/src/wrapped/wrappedlibdl.c
index 98d81034..c0f653b6 100644
--- a/src/wrapped/wrappedlibdl.c
+++ b/src/wrapped/wrappedlibdl.c
@@ -412,7 +412,7 @@ int my_dlclose(x64emu_t* emu, void *handle)
     }
     --dl->dllibs[nlib].count;
     elfheader_t* h = GetElf(dl->dllibs[nlib].lib);
-    if(!h || !h->gnuunique || actualy_closing)
+    if((h && !h->gnuunique) || !h || actualy_closing)
         DecRefCount(&dl->dllibs[nlib].lib, emu);
     return 0;
 }