[PATCH 2/2] Fix trivial memory leaks

Ryo Munakata ryomnktml at gmail.com
Sun Mar 8 03:18:33 PDT 2015


On Tue, 3 Mar 2015 12:04:23 +0200
Pekka Paalanen <ppaalanen at gmail.com> wrote:

> >  
> >  static void
> > diff --git a/xwayland/launcher.c b/xwayland/launcher.c
> > index df2efd2..63a1dea 100644
> > --- a/xwayland/launcher.c
> > +++ b/xwayland/launcher.c
> > @@ -338,6 +338,8 @@ weston_xserver_destroy(struct wl_listener *l, void *data)
> >  	if (!wxs)
> >  		return;
> >  
> > +	wl_event_source_remove(wxs->sigusr1_source);
> > +
> >  	if (wxs->loop)
> >  		weston_xserver_shutdown(wxs);
> >  
> 
> This looks suspicious. There already is:
> xwayland/launcher.c=39=handle_sigusr1(int signal_number, void *data)
> xwayland/launcher.c:47:	wl_event_source_remove(wxs->sigusr1_source);
> 
> Doesn't this lead to double-remove?

Ahh, yes, you are right.
I thought I saw valgrind reported this as a memory leak.
Now I tested it with valgrind and this part seems to be my mistake.

I just sent v2 of this patch with only the good parts.

Thank you.
-- 
Ryo Munakata <ryomnktml at gmail.com>


More information about the wayland-devel mailing list