mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
Return error if a Page already exists in Session
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
committed by
Pierre Tachoire
parent
bcf4083f9c
commit
df82d25e91
@@ -132,7 +132,8 @@ pub const Page = struct {
|
|||||||
fn init(
|
fn init(
|
||||||
alloc: std.mem.Allocator,
|
alloc: std.mem.Allocator,
|
||||||
session: *Session,
|
session: *Session,
|
||||||
) Page {
|
) !Page {
|
||||||
|
if (session.page != null) return error.SessionPageExists;
|
||||||
var page = Page{
|
var page = Page{
|
||||||
.arena = std.heap.ArenaAllocator.init(alloc),
|
.arena = std.heap.ArenaAllocator.init(alloc),
|
||||||
.session = session,
|
.session = session,
|
||||||
|
|||||||
Reference in New Issue
Block a user