code: fix a pair of leaks
This commit is contained in:
parent
0091445b9f
commit
43bcce9afe
@ -610,6 +610,9 @@ fn handleDestroy(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
|
|||||||
// Clean up the wlr_output
|
// Clean up the wlr_output
|
||||||
self.wlr_output.data = null;
|
self.wlr_output.data = null;
|
||||||
|
|
||||||
|
// Free the layout command
|
||||||
|
util.gpa.free(self.layout);
|
||||||
|
|
||||||
// Remove the destroyed output from the list
|
// Remove the destroyed output from the list
|
||||||
const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
|
const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
|
||||||
root.outputs.remove(node);
|
root.outputs.remove(node);
|
||||||
|
@ -93,6 +93,7 @@ pub fn main() anyerror!void {
|
|||||||
} else null;
|
} else null;
|
||||||
defer if (startup_process) |child| {
|
defer if (startup_process) |child| {
|
||||||
_ = child.kill() catch |e| log.err(.server, "failed to terminate startup process: {}", .{e});
|
_ = child.kill() catch |e| log.err(.server, "failed to terminate startup process: {}", .{e});
|
||||||
|
child.deinit();
|
||||||
};
|
};
|
||||||
|
|
||||||
log.info(.server, "running...", .{});
|
log.info(.server, "running...", .{});
|
||||||
|
Loading…
Reference in New Issue
Block a user