Skip to content

Commit 402f72c

Browse files
committed
cdp: adjust page deinit
1 parent e7dcb8a commit 402f72c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/browser/browser.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub const Session = struct {
153153
}
154154

155155
fn deinit(self: *Session) void {
156-
if (self.page) |*p| p.end();
156+
if (self.page) |*p| p.deinit();
157157

158158
if (self.inspector) |inspector| {
159159
inspector.deinit(self.alloc);
@@ -265,6 +265,7 @@ pub const Page = struct {
265265
self.session.window.replaceLocation(&self.location) catch |e| {
266266
log.err("reset window location: {any}", .{e});
267267
};
268+
self.doc = null;
268269

269270
// clear netsurf memory arena.
270271
parser.deinit();
@@ -273,6 +274,7 @@ pub const Page = struct {
273274
}
274275

275276
pub fn deinit(self: *Page) void {
277+
self.end();
276278
self.arena.deinit();
277279
self.session.page = null;
278280
}

0 commit comments

Comments
 (0)