mach: free EventNode(s) after poping from queue

This commit is contained in:
iddev5 2022-05-20 18:38:19 +05:30 committed by Stephen Gutekanst
parent 02b9048734
commit 7bd841a638

View file

@ -101,7 +101,10 @@ pub const CoreGlfw = struct {
} }
pub fn pollEvent(self: *CoreGlfw) ?structs.Event { 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; return null;
} }