keyboard: handle destruction

This commit is contained in:
Isaac Freund
2020-11-29 21:05:27 +01:00
parent f1e5f1aacb
commit 807d4a4212
3 changed files with 22 additions and 2 deletions

View File

@ -101,7 +101,10 @@ pub fn init(self: *Self, input_manager: *InputManager, name: [*:0]const u8) !voi
pub fn deinit(self: *Self) void {
self.cursor.deinit();
while (self.keyboards.pop()) |node| util.gpa.destroy(node);
while (self.keyboards.pop()) |node| {
node.data.deinit();
util.gpa.destroy(node);
}
while (self.focus_stack.first) |node| {
self.focus_stack.remove(node);