[PATCH 2/2] Fix trivial memory leaks

Pekka Paalanen ppaalanen at gmail.com
Tue Mar 3 02:04:23 PST 2015


On Sat, 21 Feb 2015 01:07:38 +0900
Ryo Munakata <ryomnktml at gmail.com> wrote:

> Signed-off-by: Ryo Munakata <ryomnktml at gmail.com>
> ---
>  desktop-shell/shell.c | 2 ++
>  src/compositor-x11.c  | 2 ++
>  xwayland/launcher.c   | 2 ++
>  3 files changed, 6 insertions(+)

Huh, I wonder why this didn't appear in Patchwork.

> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index f28fc10..8d54455 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -6511,6 +6511,8 @@ shell_destroy(struct wl_listener *listener, void *data)
>  		wl_client_destroy(shell->child.client);
>  	}
>  
> +	wl_event_source_remove(shell->screensaver.timer);
> +

Ok.

>  	wl_list_remove(&shell->idle_listener.link);
>  	wl_list_remove(&shell->wake_listener.link);
>  
> diff --git a/src/compositor-x11.c b/src/compositor-x11.c
> index aa1e519..e9735c5 100644
> --- a/src/compositor-x11.c
> +++ b/src/compositor-x11.c
> @@ -1454,6 +1454,8 @@ x11_compositor_get_wm_info(struct x11_compositor *c)
>  		if (atom[i] == c->atom.net_wm_state_fullscreen)
>  			c->has_net_wm_state_fullscreen = 1;
>  	}
> +
> +	free(reply);

Ok.

>  }
>  
>  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?


Thanks,
pq


More information about the wayland-devel mailing list