Skip to content

Commit 1668c88

Browse files
committed
fix(quickjs): clear weak refs before forced gc
1 parent 5bc3504 commit 1668c88

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

NativeScript/napi/quickjs/quickjs-api.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4249,7 +4249,9 @@ static int JS_BeforeGCCallback(JSRuntime* rt) {
42494249

42504250
static JSValue JSRunGCCallback(JSContext* ctx, JSValue this_val, int argc,
42514251
JSValue* argv) {
4252-
JS_RunGC(JS_GetRuntime(ctx));
4252+
JSRuntime* rt = JS_GetRuntime(ctx);
4253+
JS_ClearWeakRefKeepAlives(rt);
4254+
JS_RunGC(rt);
42534255
return JS_TRUE;
42544256
}
42554257

0 commit comments

Comments
 (0)