cdp: adjust page deinit

This commit is contained in:
Pierre Tachoire committed 2025-02-10 09:31:08 +01:00
1 parent e7dcb8a605
commit 402f72cfa8
1 file changed
+3 -1
+3 -1
View File
@@ -153,7 +153,7 @@ pub const Session = struct {
}
fn deinit(self: *Session) void {
if (self.page) |*p| p.end();
if (self.page) |*p| p.deinit();
if (self.inspector) |inspector| {
inspector.deinit(self.alloc);
@@ -265,6 +265,7 @@ pub const Page = struct {
self.session.window.replaceLocation(&self.location) catch |e| {
log.err("reset window location: {any}", .{e});
};
self.doc = null;
// clear netsurf memory arena.
parser.deinit();
@@ -273,6 +274,7 @@ pub const Page = struct {
}
pub fn deinit(self: *Page) void {
self.end();
self.arena.deinit();
self.session.page = null;
}