assert that next_tick_count is 0 after abort

This commit is contained in:
Muki Kiboigo committed 2026-05-25 17:12:40 -07:00
1 parent c927fc927d
commit 17e166c35f
1 file changed
+6 -7
+6 -7
View File
@@ -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();