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

Bryce Harrington bryce at osg.samsung.com
Fri Aug 7 12:17:12 PDT 2015


On Fri, Aug 07, 2015 at 09:19:44AM +0900, Ryo Munakata wrote:
> 
> This annoys me when using Valgrind.
> 
> Reviewed-by: Ryo Munakata <ryomnktml at gmail.com>
> 
> Thank you.

Makes sense.  Pushed to trunk:
To ssh://git.freedesktop.org/git/wayland/weston
   74a635b..87c862a  master -> master

Btw, are there changes that could be done to the keyboard test to get
better coverage of multi-seat device adding and removing?  This seems
like something that ought to have been caught by a test...

Bryce

> 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>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list