mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-31 11:08:25 -05:00
Merge pull request #926 from emersion/fix-x11-backend-memory-leaks
Fix some backend memory leaks
This commit is contained in:
commit
a0f4903063
12 changed files with 66 additions and 38 deletions
|
|
@ -138,7 +138,7 @@ void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
|
|||
}
|
||||
|
||||
void wlr_keyboard_init(struct wlr_keyboard *kb,
|
||||
struct wlr_keyboard_impl *impl) {
|
||||
const struct wlr_keyboard_impl *impl) {
|
||||
kb->impl = impl;
|
||||
wl_signal_init(&kb->events.key);
|
||||
wl_signal_init(&kb->events.modifiers);
|
||||
|
|
@ -154,15 +154,15 @@ void wlr_keyboard_destroy(struct wlr_keyboard *kb) {
|
|||
if (kb == NULL) {
|
||||
return;
|
||||
}
|
||||
xkb_state_unref(kb->xkb_state);
|
||||
xkb_keymap_unref(kb->keymap);
|
||||
close(kb->keymap_fd);
|
||||
if (kb->impl && kb->impl->destroy) {
|
||||
kb->impl->destroy(kb);
|
||||
} else {
|
||||
wl_list_remove(&kb->events.key.listener_list);
|
||||
free(kb);
|
||||
}
|
||||
xkb_state_unref(kb->xkb_state);
|
||||
xkb_keymap_unref(kb->keymap);
|
||||
close(kb->keymap_fd);
|
||||
free(kb);
|
||||
}
|
||||
|
||||
void wlr_keyboard_led_update(struct wlr_keyboard *kb, uint32_t leds) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <wlr/types/wlr_pointer.h>
|
||||
|
||||
void wlr_pointer_init(struct wlr_pointer *pointer,
|
||||
struct wlr_pointer_impl *impl) {
|
||||
const struct wlr_pointer_impl *impl) {
|
||||
pointer->impl = impl;
|
||||
wl_signal_init(&pointer->events.motion);
|
||||
wl_signal_init(&pointer->events.motion_absolute);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue