Skip to content

Lightpanda: the headless browser designed for AI and automation

`CDP`: reset download session id

Halil Durakd4ffd9427c8c
diff --git a/src/server/cdp/CDP.zig b/src/server/cdp/CDP.zig
index 819f4823b..633500d52 100644
--- a/src/server/cdp/CDP.zig
+++ b/src/server/cdp/CDP.zig
@@ -1325,6 +1325,11 @@ pub const BrowserContext = struct {
}
fn destroySession(self: *BrowserContext, attached: *AttachedSession) void {
+ if (self.download_session_id) |download_session_id| {
+ if (std.mem.eql(u8, download_session_id, attached.id)) {
+ self.download_session_id = null;
+ }
+ }
self.notification.unregisterAll(attached);
attached.inspector_session.deinit();
self.cdp.allocator.destroy(attached);