aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/libinput/keyboard.c1
-rw-r--r--types/wlr_keyboard.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c
index 2a626148..53c3a61b 100644
--- a/backend/libinput/keyboard.c
+++ b/backend/libinput/keyboard.c
@@ -21,7 +21,6 @@ static void wlr_libinput_keyboard_destroy(struct wlr_keyboard *wlr_kb) {
struct wlr_libinput_keyboard *wlr_libinput_kb =
(struct wlr_libinput_keyboard *)wlr_kb;
libinput_device_unref(wlr_libinput_kb->libinput_dev);
- free(wlr_libinput_kb);
}
struct wlr_keyboard_impl impl = {
diff --git a/types/wlr_keyboard.c b/types/wlr_keyboard.c
index dd90b38f..b356f63a 100644
--- a/types/wlr_keyboard.c
+++ b/types/wlr_keyboard.c
@@ -41,9 +41,9 @@ void wlr_keyboard_destroy(struct wlr_keyboard *kb) {
kb->impl->destroy(kb);
} else {
wl_list_remove(&kb->events.key.listener_list);
- free(kb);
}
close(kb->keymap_fd);
+ free(kb);
}
void wlr_keyboard_led_update(struct wlr_keyboard *kb, uint32_t leds) {