command/layout: fix a memory leak
This commit is contained in:
parent
615beab2e6
commit
84abdfaced
@ -33,7 +33,9 @@ pub fn outputLayout(
|
|||||||
if (args.len > 2) return Error.TooManyArguments;
|
if (args.len > 2) return Error.TooManyArguments;
|
||||||
|
|
||||||
const output = seat.focused_output;
|
const output = seat.focused_output;
|
||||||
|
const old_layout_namespace = output.layout_namespace;
|
||||||
output.layout_namespace = try util.gpa.dupe(u8, args[1]);
|
output.layout_namespace = try util.gpa.dupe(u8, args[1]);
|
||||||
|
if (old_layout_namespace) |old| util.gpa.free(old);
|
||||||
output.handleLayoutNamespaceChange();
|
output.handleLayoutNamespaceChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user