[PATCH weston] input: Stop leaking libinput event source on session deactivation

Pekka Paalanen ppaalanen at gmail.com
Thu Jul 27 11:45:53 UTC 2017


On Thu, 27 Jul 2017 06:34:02 +1000
Peter Hutterer <peter.hutterer at who-t.net> wrote:

> On Tue, Jul 25, 2017 at 04:49:52PM -0500, Derek Foreman wrote:
> > On 2017-07-25 04:39 PM, Derek Foreman wrote:  
> > > This is easily noticed as a leaked fd on every VC switch.
> > > 
> > > Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
> > > ---
> > >   libweston/libinput-seat.c | 5 ++++-
> > >   1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libweston/libinput-seat.c b/libweston/libinput-seat.c
> > > index 8cf5666b..953f6205 100644
> > > --- a/libweston/libinput-seat.c
> > > +++ b/libweston/libinput-seat.c
> > > @@ -134,6 +134,8 @@ udev_input_disable(struct udev_input *input)
> > >   	if (input->suspended)
> > >   		return;
> > > +	wl_event_source_remove(input->libinput_source);
> > > +	input->libinput_source = NULL;  
> > 
> > Actually having second thoughts about this - can this fd ever change on us?
> > Or can we just keep the event source we added in the first call to
> > udev_input_enable forever?
> > 
> > Peter - can you school me on libinput usage here?  
> 
> the fd you get from libinput is an epoll fd, so it won't ever change for
> this libinput ontext. And the API is designed around it, so we have to guarantee
> that the fd is always the same anyway.
> 
> this patch lgtm, Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Thank guys, pushed by my tested-by:
   6b65d8f1..0e4e570c  master -> master


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170727/2d665587/attachment.sig>


More information about the wayland-devel mailing list