diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-01-28 22:00:22 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-01-28 22:00:22 +0100 |
| commit | 7ebfe844892f9f4822046f98f91bfa85b3e39714 (patch) | |
| tree | ffbaea7de870b4340acb6da9970e5a047e9a14fe /src/librarian/library.c | |
| parent | 4e645debaadb92a8dc38e305bac2ccdee939c3ca (diff) | |
| download | box64-7ebfe844892f9f4822046f98f91bfa85b3e39714.tar.gz box64-7ebfe844892f9f4822046f98f91bfa85b3e39714.zip | |
Fixed some isse with last lib init/fini refactor (fixed ut2004, maybe pokewilds too)
Diffstat (limited to 'src/librarian/library.c')
| -rwxr-xr-x | src/librarian/library.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/librarian/library.c b/src/librarian/library.c index 1c18c9dc..76fc2898 100755 --- a/src/librarian/library.c +++ b/src/librarian/library.c @@ -1058,13 +1058,17 @@ void setNeededLibs(library_t* lib, int n, ...) va_end (va); } -void IncRefCount(library_t* lib) +void IncRefCount(library_t* lib, x64emu_t* emu) { - if(lib->type!=LIB_WRAPPED && lib->type!=LIB_UNNKNOW) + if(lib->type==LIB_UNNKNOW) return; - if(lib->type==LIB_WRAPPED) { - ++lib->w.refcnt; - } else { - ++lib->e.elf->refcnt; + if(!lib->active) + ReloadLibrary(lib, emu); + switch (lib->type) { + case LIB_WRAPPED: + ++lib->w.refcnt; + break; + case LIB_EMULATED: + ++lib->e.elf->refcnt; } } \ No newline at end of file |