From 70018a774bf7411ef7550aa4fb3eb153d17dcfd6 Mon Sep 17 00:00:00 2001 From: rajdakin Date: Fri, 9 Apr 2021 17:52:59 +0200 Subject: Fixed the libraries free ordering --- src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 946cd58a..3fb8d9a0 100755 --- a/src/main.c +++ b/src/main.c @@ -599,10 +599,10 @@ void endBox64() return; x64emu_t* emu = thread_get_emu(); - //atexit first - printf_log(LOG_DEBUG, "Calling atexit registered functions\n"); + // atexit first + printf_log(LOG_DEBUG, "Calling atexit registered functions (exiting box64)\n"); CallAllCleanup(emu); - // than call all the Fini (some "smart" ordering of the fini may be needed, but for now, callign in this order should be good enough) + // then call all the fini printf_log(LOG_DEBUG, "Calling fini for all loaded elfs and unload native libs\n"); RunElfFini(my_context->elfs[0], emu); #ifdef DYNAREC @@ -992,7 +992,7 @@ int main(int argc, const char **argv, const char **env) { // pre-load lib if needed if(ld_preload.size) { for (int i=0; imaplib, &my_context->neededlibs, 0, my_context, emu)) { + if(LoadNeededLibs(elf_header, my_context->maplib, &my_context->neededlibs, NULL, 0, my_context, emu)) { printf_log(LOG_NONE, "Error: loading needed libs in elf %s\n", my_context->argv[0]); FreeBox64Context(&my_context); return -1; -- cgit 1.4.1