diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-04-10 18:51:07 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-04-10 18:51:16 +0200 |
| commit | 5d6307184941f6f2171153df6a5bb0105fcbce9e (patch) | |
| tree | c0c31a50eac0c58725ba8418154ca48a3c4ae2a9 /src/wrapped | |
| parent | 8c98c7b67580b2807d37fa03f59416f4526df770 (diff) | |
| download | box64-5d6307184941f6f2171153df6a5bb0105fcbce9e.tar.gz box64-5d6307184941f6f2171153df6a5bb0105fcbce9e.zip | |
[ELFLOADER] Improved handling of Failed-to-load library (and unloading of libs too)
Diffstat (limited to 'src/wrapped')
| -rwxr-xr-x | src/wrapped/wrappedlibdl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wrapped/wrappedlibdl.c b/src/wrapped/wrappedlibdl.c index 952de79d..2089a12c 100755 --- a/src/wrapped/wrappedlibdl.c +++ b/src/wrapped/wrappedlibdl.c @@ -339,7 +339,9 @@ int my_dlclose(x64emu_t* emu, void *handle) return -1; } dl->count[nlib] = dl->count[nlib]-1; - FiniLibrary(dl->libs[nlib], emu); + if(!DecRefCount(&dl->libs[nlib], emu)) { + dl->count[nlib] = 0; + } return 0; } int my_dladdr1(x64emu_t* emu, void *addr, void *i, void** extra_info, int flags) |