about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorrajdakin <rajdakin@gmail.com>2021-04-09 17:52:59 +0200
committerrajdakin <rajdakin@gmail.com>2021-04-09 17:52:59 +0200
commit70018a774bf7411ef7550aa4fb3eb153d17dcfd6 (patch)
treebd8a6c823b307e1a431a01ea3e27b8d0ac282bfe /src/main.c
parent009bb94f17803dff459b812d7314e300a1b31e1e (diff)
downloadbox64-70018a774bf7411ef7550aa4fb3eb153d17dcfd6.tar.gz
box64-70018a774bf7411ef7550aa4fb3eb153d17dcfd6.zip
Fixed the libraries free ordering
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c10
1 files changed, 5 insertions, 5 deletions
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; i<ld_preload.size; ++i) {
-            if(AddNeededLib(NULL, NULL, 0, ld_preload.paths[i], my_context, emu)) {
+            if(AddNeededLib(NULL, NULL, NULL, 0, ld_preload.paths[i], my_context, emu)) {
                 if(!strstr(ld_preload.paths[i], "vgpreload_"))
                     printf_log(LOG_INFO, "Warning, cannot pre-load lib: \"%s\"\n", ld_preload.paths[i]);
             }            
@@ -1000,7 +1000,7 @@ int main(int argc, const char **argv, const char **env) {
     }
     FreeCollection(&ld_preload);
     // Call librarian to load all dependant elf
-    if(LoadNeededLibs(elf_header, my_context->maplib, &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;