about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/box64context.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/box64context.c b/src/box64context.c
index 1558811e..ee56ce5a 100755
--- a/src/box64context.c
+++ b/src/box64context.c
@@ -270,6 +270,13 @@ void FreeBox64Context(box64context_t** context)
     if(ctx->tlsdata)
         free(ctx->tlsdata);
 
+    free_neededlib(&ctx->neededlibs);
+
+    if(ctx->emu_sig)
+        FreeX64Emu(&ctx->emu_sig);
+
+    finiAllHelpers(ctx);
+
     pthread_mutex_destroy(&ctx->mutex_once);
     pthread_mutex_destroy(&ctx->mutex_once2);
     pthread_mutex_destroy(&ctx->mutex_trace);
@@ -282,13 +289,6 @@ void FreeBox64Context(box64context_t** context)
     pthread_mutex_destroy(&ctx->mutex_thread);
     pthread_mutex_destroy(&ctx->mutex_bridge);
 
-    free_neededlib(&ctx->neededlibs);
-
-    if(ctx->emu_sig)
-        FreeX64Emu(&ctx->emu_sig);
-
-    finiAllHelpers(ctx);
-
     free(ctx);
 }