mirror of
https://github.com/labwc/labwc.git
synced 2025-11-06 13:29:58 -05:00
rcxml.c: fix mem leak when deduplicating keybinds
Before this patch `keybind->keysyms` wasn't free'd when - deduplicating keybinds - removing keybinds due to empty action list This patch creates a shared `keybind_destroy()` helper which gets used in all cases where a keybind is destroyed.
This commit is contained in:
parent
07110d41ff
commit
6754801052
3 changed files with 14 additions and 4 deletions
|
|
@ -188,3 +188,12 @@ keybind_create(const char *keybind)
|
|||
wl_list_init(&k->actions);
|
||||
return k;
|
||||
}
|
||||
|
||||
void
|
||||
keybind_destroy(struct keybind *keybind)
|
||||
{
|
||||
assert(wl_list_empty(&keybind->actions));
|
||||
|
||||
zfree(keybind->keysyms);
|
||||
zfree(keybind);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue