From 181c5b2e85babe7dc472dedcadad4d69cebc4ade Mon Sep 17 00:00:00 2001 From: kason Date: Mon, 16 Sep 2024 11:22:03 +0800 Subject: [PATCH] fix mem leak --- quickjs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quickjs.c b/quickjs.c index 642ae3429..5810a411a 100644 --- a/quickjs.c +++ b/quickjs.c @@ -5556,6 +5556,10 @@ void __JS_FreeValueRT(JSRuntime *rt, JSValue v) if (rt->gc_phase == JS_GC_PHASE_NONE) { free_zero_refcount(rt); } + } else if (p->mark == 0) { + p->mark = 1; + list_del(&p->link); + list_add_tail(&p->link, &rt->tmp_obj_list); } } break;