aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-07-17 16:01:35 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-07-17 16:01:35 +0200
commit43bcce9afe70e321fdfd96a24ec10ee21ed099c3 (patch)
tree1a45725a340e9adb4ba2eba0587654bf267b420b
parent0091445b9fddf8cba761c0a79188f12d1174cc65 (diff)
downloadriver-43bcce9afe70e321fdfd96a24ec10ee21ed099c3.tar.gz
river-43bcce9afe70e321fdfd96a24ec10ee21ed099c3.tar.xz
code: fix a pair of leaks
-rw-r--r--river/Output.zig3
-rw-r--r--river/main.zig1
2 files changed, 4 insertions, 0 deletions
diff --git a/river/Output.zig b/river/Output.zig
index c7b576e..fdefb0f 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -610,6 +610,9 @@ fn handleDestroy(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
// Clean up the wlr_output
self.wlr_output.data = null;
+ // Free the layout command
+ util.gpa.free(self.layout);
+
// Remove the destroyed output from the list
const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
root.outputs.remove(node);
diff --git a/river/main.zig b/river/main.zig
index e01b95a..94eff88 100644
--- a/river/main.zig
+++ b/river/main.zig
@@ -93,6 +93,7 @@ pub fn main() anyerror!void {
} else null;
defer if (startup_process) |child| {
_ = child.kill() catch |e| log.err(.server, "failed to terminate startup process: {}", .{e});
+ child.deinit();
};
log.info(.server, "running...", .{});