From 43bcce9afe70e321fdfd96a24ec10ee21ed099c3 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Fri, 17 Jul 2020 16:01:35 +0200 Subject: [PATCH] code: fix a pair of leaks --- river/Output.zig | 3 +++ river/main.zig | 1 + 2 files changed, 4 insertions(+) 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...", .{});