Add XkbBinding.deinit()

Also fixed a crash if two non-spawn keybinds had the same keys
This commit is contained in:
Ben Buhse 2026-02-22 14:57:41 -06:00
commit 9fef3f70f5
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
3 changed files with 43 additions and 14 deletions

View file

@ -185,13 +185,7 @@ pub fn load(config: *Config, parser: *kdl.Parser, hostname: ?[]const u8) !void {
.keysym = keysym,
});
if (gop.found_existing) {
switch (gop.value_ptr.*) {
.spawn => |argv| {
for (argv) |arg| utils.gpa.free(arg);
utils.gpa.free(argv);
},
else => unreachable,
}
gop.value_ptr.deinit();
}
gop.value_ptr.* = command;
} else {