mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +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,
|
NSLOG(dukky, DEBUG,
|
||||||
"New javascript/duktape compartment, win_priv=%p, doc_priv=%p", win_priv,
|
"New javascript/duktape compartment, win_priv=%p, doc_priv=%p", win_priv,
|
||||||
doc_priv);
|
doc_priv);
|
||||||
|
if (CTX != NULL) {
|
||||||
duk_set_top(ctx->ctx, 0);
|
duk_set_top(ctx->ctx, 0);
|
||||||
|
duk_gc(ctx->ctx, 0);
|
||||||
|
duk_gc(ctx->ctx, DUK_GC_COMPACT);
|
||||||
|
}
|
||||||
duk_push_thread(ctx->ctx);
|
duk_push_thread(ctx->ctx);
|
||||||
ctx->thread = duk_require_context(ctx->ctx, -1);
|
ctx->thread = duk_require_context(ctx->ctx, -1);
|
||||||
duk_push_int(CTX, 0);
|
duk_push_int(CTX, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user