From 17e166c35f7df51b23efcd3078f1c01880650792 Mon Sep 17 00:00:00 2001 From: Muki Kiboigo Date: Mon, 25 May 2026 17:09:15 -0700 Subject: [PATCH] assert that next_tick_count is 0 after abort --- src/browser/HttpClient.zig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/browser/HttpClient.zig b/src/browser/HttpClient.zig index 36204451..adf05f2b 100644 --- a/src/browser/HttpClient.zig +++ b/src/browser/HttpClient.zig @@ -245,14 +245,13 @@ pub fn init(self: *Client, allocator: Allocator, network: *Network, cdp: ?*CDP) pub fn deinit(self: *Client) void { self.abort(); - // Drain Next Tick Queue - while (self.next_tick_queue.popFirst()) |node| { - const n: *NextTickNode = @fieldParentPtr("node", node); - if (n.abort) |abort_cb| { - abort_cb(n.ctx); - } + if (comptime IS_DEBUG) { + lp.assert( + self.next_tick_count == 0, + "next_tick_count must be 0", + .{ .value = self.next_tick_count }, + ); } - self.next_tick_count = 0; self.handles.deinit();