[PATCH weston] input: when destroying a seat, remove keyboard focus first

Derek Foreman derekf at osg.samsung.com
Thu Aug 6 10:19:51 PDT 2015


If we destroy all the devices before trying to remove keyboard focus
we'll segfault because we destroyed the keyboard.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/libinput-seat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libinput-seat.c b/src/libinput-seat.c
index e6d44b0..c9f9ed2 100644
--- a/src/libinput-seat.c
+++ b/src/libinput-seat.c
@@ -383,9 +383,10 @@ udev_seat_destroy(struct udev_seat *seat)
 	struct weston_keyboard *keyboard =
 		weston_seat_get_keyboard(&seat->base);
 
-	udev_seat_remove_devices(seat);
 	if (keyboard)
 		notify_keyboard_focus_out(&seat->base);
+
+	udev_seat_remove_devices(seat);
 	weston_seat_release(&seat->base);
 	wl_list_remove(&seat->output_create_listener.link);
 	free(seat);
-- 
2.4.6



More information about the wayland-devel mailing list