From 33846405d8e0af86bb5cfb9dab4ea5026fadb614 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 9 Mar 2024 14:10:09 +0100 Subject: Improved unload of libs (help wine when dlopen / dlclose is supposed to unload the lib so it can be dlopen again) --- src/wrapped/wrappedlibc.c | 3 ++- src/wrapped/wrappedlibdl.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/wrapped') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 0100385c..6ff9bab7 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -3440,7 +3440,8 @@ static void* timed_exit_thread(void* a) { // this is a workaround for some NVidia drivers on ARM64 that may freeze at exit // waiting on a pthread_cond_destroy - usleep(500000); // wait 1/2 a second + usleep(5000000); // wait 5 seconds + printf_log(LOG_DEBUG, "Too late, forced exit...\n"); _exit(box64_exit_code); // force exit, something is wrong } 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; } -- cgit 1.4.1