mach: free EventNode(s) after poping from queue
This commit is contained in:
parent
02b9048734
commit
7bd841a638
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue