wayland/keyboard: Fix anonymous file leak on repeated keymap changes

keymap_rofile was being overwritten without the old one being free'd on
repeated calls of meta_wayland_keyboard_take_keymap().

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1304
This commit is contained in:
Sebastian Keller 2020-06-08 10:02:49 +02:00 committed by Jonas Ådahl
parent 94fb82137f
commit 51a8193c16

View File

@ -147,6 +147,7 @@ meta_wayland_keyboard_take_keymap (MetaWaylandKeyboard *keyboard,
} }
keymap_size = strlen (keymap_string) + 1; keymap_size = strlen (keymap_string) + 1;
g_clear_pointer (&xkb_info->keymap_rofile, meta_anonymous_file_free);
xkb_info->keymap_rofile = xkb_info->keymap_rofile =
meta_anonymous_file_new (keymap_size, (const uint8_t *) keymap_string); meta_anonymous_file_new (keymap_size, (const uint8_t *) keymap_string);