diff --git a/quickjs.c b/quickjs.c index 17c35d0..af26d12 100644 --- a/quickjs.c +++ b/quickjs.c @@ -2106,7 +2106,6 @@ void JS_FreeRuntime(JSRuntime *rt) printf("Secondary object leaks: %d\n", count); } #endif - assert(list_empty(&rt->gc_obj_list)); /* free the classes */ for(i = 0; i < rt->class_count; i++) { @@ -2237,6 +2236,9 @@ void JS_FreeRuntime(JSRuntime *rt) js_free_rt(rt, fs); } + // FinalizationRegistry finalizers have run, no objects should remain + assert(list_empty(&rt->gc_obj_list)); + { JSMallocState *ms = &rt->malloc_state; rt->mf.js_free(ms->opaque, rt);