mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Move "no more objects" assert to right place (#649)
No test because I can only get it to trigger with qjs, not run-test262, but the problem is that we need to run FinalizationRegistry finalizers before asserting no objects remain. Fixes: https://github.com/quickjs-ng/quickjs/issues/648
This commit is contained in:
parent
37fe427d59
commit
0a706236d7
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue