From 7a619ab770863b7bb5786cc8c311929576fdd818 Mon Sep 17 00:00:00 2001 From: Squibid Date: Fri, 12 Dec 2025 17:34:22 -0500 Subject: [PATCH] fix only one hook working per event (I forgot to zero the memory) --- src/types/Events.zig | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/types/Events.zig b/src/types/Events.zig index e8d4605..02a69b4 100644 --- a/src/types/Events.zig +++ b/src/types/Events.zig @@ -25,10 +25,8 @@ pub fn put(self: *Events, key: []const u8, hook: *const Hook) !void { ll = sll; } else { ll = try self.allocator.create(std.SinglyLinkedList); + ll.* = .{}; try self.events.put(key, ll); - if (self.events.get(key)) |sll| { - ll = sll; - } } const data = try self.allocator.create(Node); data.* = .{ @@ -47,10 +45,6 @@ pub fn exec(self: *Events, event: []const u8, args: anytype) void { while (node) |n| : (node = n.next) { const data: *Node = @fieldParentPtr("node", n); data.hook.callback(args); - - // FIXME: not sure why but for some reason our ll doesn't seem to want to - // admit that there's nothing after the first node. - break; } } }