server: newSession on disposeBrowserContext

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-10-07 21:14:55 +02:00
parent 4c225e515d
commit 76a9034668
3 changed files with 29 additions and 4 deletions

View File

@@ -226,7 +226,7 @@ fn disposeBrowserContext(
alloc: std.mem.Allocator,
id: ?u16,
scanner: *std.json.Scanner,
_: *Ctx,
ctx: *Ctx,
) ![]const u8 {
// input
@@ -236,7 +236,11 @@ fn disposeBrowserContext(
const msg = try getMsg(alloc, Params, scanner);
// output
return result(alloc, id orelse msg.id.?, null, {}, null);
const res = try result(alloc, id orelse msg.id.?, null, .{}, null);
defer alloc.free(res);
try server.sendSync(ctx, res);
return error.DisposeBrowserContext;
}
// TODO: hard coded IDs