aboutsummaryrefslogtreecommitdiff
path: root/src/seat.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-04-18 12:21:43 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-04-18 12:21:43 +0200
commitcd19a4615b822ab85ebe1430ec956f6b22f3d008 (patch)
treec3b9cd94870ecb8e37c5ca9d29cd1077c7820bef /src/seat.zig
parented7aca261bc51790334a0adc9e00df5eda6dbc83 (diff)
downloadriver-cd19a4615b822ab85ebe1430ec956f6b22f3d008.tar.gz
river-cd19a4615b822ab85ebe1430ec956f6b22f3d008.tar.xz
Properly clean up resources on exit
Diffstat (limited to 'src/seat.zig')
-rw-r--r--src/seat.zig13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/seat.zig b/src/seat.zig
index dc25802..e011579 100644
--- a/src/seat.zig
+++ b/src/seat.zig
@@ -50,8 +50,17 @@ pub const Seat = struct {
self.focus_stack.init();
}
- pub fn destroy(self: Self) void {
- self.cursor.destroy();
+ pub fn deinit(self: *Self) void {
+ self.cursor.deinit();
+
+ while (self.keyboards.pop()) |node| {
+ self.input_manager.server.allocator.destroy(node);
+ }
+
+ while (self.focus_stack.first) |node| {
+ self.focus_stack.remove(node);
+ self.input_manager.server.allocator.destroy(node);
+ }
}
/// Set the current focus. If a visible view is passed it will be focused.