diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-02-16 13:36:26 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-02-16 13:36:26 +0100 |
| commit | 21b3292fff977a6c1370ccbd2baade3d0a5cdc46 (patch) | |
| tree | 48e0420e58e3068f3689c67b069267ad7c16615c /src | |
| parent | 39ebeb2401c935bbd7d487b2fcc50cc520cbc31c (diff) | |
| download | box64-21b3292fff977a6c1370ccbd2baade3d0a5cdc46.tar.gz box64-21b3292fff977a6c1370ccbd2baade3d0a5cdc46.zip | |
Fixed an issue with Emulated lib refcount
Diffstat (limited to 'src')
| -rwxr-xr-x | src/librarian/library.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librarian/library.c b/src/librarian/library.c index e46fe418..3cfb2bee 100755 --- a/src/librarian/library.c +++ b/src/librarian/library.c @@ -518,10 +518,11 @@ int FiniLibrary(library_t* lib, x64emu_t* emu) lib->active = 0; return 0; case LIB_EMULATED: - if(emu) - RunElfFini(lib->e.elf, emu); - if(!lib->e.elf->refcnt) + if(!--lib->e.elf->refcnt) { + if(emu) + RunElfFini(lib->e.elf, emu); lib->active = 0; + } return 0; } return 1; // bad type |