]> git.kaiwu.me - quickjs.git/commitdiff
call js_std_free_handlers() in the code generated by qjsc (github issue #96)
authorFabrice Bellard <fabrice@bellard.org>
Fri, 22 Dec 2023 10:07:00 +0000 (11:07 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Fri, 22 Dec 2023 10:07:00 +0000 (11:07 +0100)
Makefile
qjsc.c

index 082fc734547dab514b29122cdc63a6c9225ac3c2..9b003f01d2053f74dc8d6157d7fc9b16063ae5bb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -155,10 +155,9 @@ endif
 
 # examples
 ifeq ($(CROSS_PREFIX),)
-ifdef CONFIG_ASAN
-PROGS+=
-else
-PROGS+=examples/hello examples/hello_module examples/test_fib
+PROGS+=examples/hello
+ifndef CONFIG_ASAN
+PROGS+=examples/hello_module examples/test_fib
 ifndef CONFIG_DARWIN
 PROGS+=examples/fib.so examples/point.so
 endif
diff --git a/qjsc.c b/qjsc.c
index d3178268d7ae87ae9f2bc77c062f267788c233da..3dc2a12d4b8b7e31d744b4ad16da63044989e2be 100644 (file)
--- a/qjsc.c
+++ b/qjsc.c
@@ -330,6 +330,7 @@ static const char main_c_template1[] =
 
 static const char main_c_template2[] =
     "  js_std_loop(ctx);\n"
+    "  js_std_free_handlers(rt);\n"
     "  JS_FreeContext(ctx);\n"
     "  JS_FreeRuntime(rt);\n"
     "  return 0;\n"