update page.js on context.deinit

This commit is contained in:
Karl Seguin
2026-01-28 14:24:28 +08:00
parent c11fa122af
commit 20931eb9d6

View File

@@ -150,6 +150,11 @@ pub fn fromIsolate(isolate: js.Isolate) *Context {
}
pub fn deinit(self: *Context) void {
var page = self.page;
const prev_context = page.js;
page.js = self;
defer page.js = prev_context;
{
var it = self.identity_map.valueIterator();
while (it.next()) |global| {