aboutsummaryrefslogtreecommitdiff
path: root/src/root.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/root.zig
parented7aca261bc51790334a0adc9e00df5eda6dbc83 (diff)
downloadriver-cd19a4615b822ab85ebe1430ec956f6b22f3d008.tar.gz
river-cd19a4615b822ab85ebe1430ec956f6b22f3d008.tar.xz
Properly clean up resources on exit
Diffstat (limited to 'src/root.zig')
-rw-r--r--src/root.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/root.zig b/src/root.zig
index eb7b0f3..7246577 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -50,7 +50,11 @@ pub const Root = struct {
self.transaction_timer = null;
}
- pub fn destroy(self: Self) void {
+ pub fn deinit(self: *Self) void {
+ while (self.outputs.pop()) |output_node| {
+ output_node.data.deinit();
+ self.server.allocator.destroy(output_node);
+ }
c.wlr_output_layout_destroy(self.wlr_output_layout);
}