Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions quickjs-libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4116,6 +4116,11 @@ void js_std_free_handlers(JSRuntime *rt)
JSThreadState *ts = JS_GetRuntimeOpaque(rt);
struct list_head *el, *el1;

/* Run GC before freeing the JSThreadState. The JSThreadState */
/* contains the worker port_list and JS_FreeRuntime migth reference */
/* it when it does worker defered finalization in JS_FreeRuntime */
JS_RunGC(rt);

list_for_each_safe(el, el1, &ts->os_rw_handlers) {
JSOSRWHandler *rh = list_entry(el, JSOSRWHandler, link);
free_rw_handler(rt, rh);
Expand Down