From 7bd841a6387b5825b856eaf128a987ff65631151 Mon Sep 17 00:00:00 2001 From: iddev5 Date: Fri, 20 May 2022 18:38:19 +0530 Subject: [PATCH] mach: free EventNode(s) after poping from queue --- src/native.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/native.zig b/src/native.zig index c004aa18..42120e32 100644 --- a/src/native.zig +++ b/src/native.zig @@ -101,7 +101,10 @@ pub const CoreGlfw = struct { } pub fn pollEvent(self: *CoreGlfw) ?structs.Event { - if (self.events.popFirst()) |n| return n.data; + if (self.events.popFirst()) |n| { + defer self.allocator.destroy(n); + return n.data; + } return null; }