mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
change in page url's init/deinit logic
this must be done in runtime now sadly, good thing is it doesn't add much and `getHref` can be spread everywhere without pointer life concerns
This commit is contained in:
@@ -126,8 +126,11 @@ pub const Page = struct {
|
|||||||
const browser = session.browser;
|
const browser = session.browser;
|
||||||
const script_manager = ScriptManager.init(browser, self);
|
const script_manager = ScriptManager.init(browser, self);
|
||||||
|
|
||||||
|
const url = try URL.parse("about:blank", null);
|
||||||
|
errdefer url.deinit();
|
||||||
|
|
||||||
self.* = .{
|
self.* = .{
|
||||||
.url = URL.empty,
|
.url = url,
|
||||||
.mode = .{ .pre = {} },
|
.mode = .{ .pre = {} },
|
||||||
.window = try Window.create(null, null),
|
.window = try Window.create(null, null),
|
||||||
.arena = arena,
|
.arena = arena,
|
||||||
@@ -156,6 +159,7 @@ pub const Page = struct {
|
|||||||
|
|
||||||
self.http_client.abort();
|
self.http_client.abort();
|
||||||
self.script_manager.deinit();
|
self.script_manager.deinit();
|
||||||
|
self.url.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn reset(self: *Page) !void {
|
fn reset(self: *Page) !void {
|
||||||
|
|||||||
Reference in New Issue
Block a user