mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Force a GC to ensure old compartment goes away
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
ac512958ff
commit
3ba50e8574
@ -611,7 +611,11 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv, void *doc_priv)
|
||||
NSLOG(dukky, DEBUG,
|
||||
"New javascript/duktape compartment, win_priv=%p, doc_priv=%p", win_priv,
|
||||
doc_priv);
|
||||
duk_set_top(ctx->ctx, 0);
|
||||
if (CTX != NULL) {
|
||||
duk_set_top(ctx->ctx, 0);
|
||||
duk_gc(ctx->ctx, 0);
|
||||
duk_gc(ctx->ctx, DUK_GC_COMPACT);
|
||||
}
|
||||
duk_push_thread(ctx->ctx);
|
||||
ctx->thread = duk_require_context(ctx->ctx, -1);
|
||||
duk_push_int(CTX, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user