diff --git a/river/command/layout.zig b/river/command/layout.zig index 4ba4f19..e0967c9 100644 --- a/river/command/layout.zig +++ b/river/command/layout.zig @@ -33,7 +33,9 @@ pub fn outputLayout( if (args.len > 2) return Error.TooManyArguments; const output = seat.focused_output; + const old_layout_namespace = output.layout_namespace; output.layout_namespace = try util.gpa.dupe(u8, args[1]); + if (old_layout_namespace) |old| util.gpa.free(old); output.handleLayoutNamespaceChange(); }