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

Ryo Munakata ryomnktml at gmail.com
Thu Aug 6 17:19:44 PDT 2015


This annoys me when using Valgrind.

Reviewed-by: Ryo Munakata <ryomnktml at gmail.com>

Thank you.

On Thu,  6 Aug 2015 12:19:51 -0500
Derek Foreman <derekf at osg.samsung.com> wrote:

> 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

-- 
Ryo Munakata <ryomnktml at gmail.com>


More information about the wayland-devel mailing list