[PATCH 4/4] xwayland: Fixme: Free windows in hash

Kristian Høgsberg hoegsberg at gmail.com
Mon Jul 9 14:32:15 PDT 2012


On Tue, Jul 03, 2012 at 11:10:11PM +0200, Martin Minarik wrote:
> Use custom wrapper iterator function for destroying each window in hash.
> ---
>  src/xwayland/window-manager.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
> index 6e032ea..5d7e653 100644
> --- a/src/xwayland/window-manager.c
> +++ b/src/xwayland/window-manager.c
> @@ -718,6 +718,12 @@ weston_wm_window_create(struct weston_wm *wm,
>  }
>  
>  static void
> +weston_wm_window_destroy_iterator_func(void *element, void *data)
> +{
> +	weston_wm_window_destroy(element);
> +}
> +

Please keep this one close the the hash_table_for_each call().

> +static void
>  weston_wm_window_destroy(struct weston_wm_window *window)
>  {
>  	hash_table_remove(window->wm->window_hash, window->id);
> @@ -1212,7 +1218,8 @@ weston_wm_create(struct weston_xserver *wxs)
>  void
>  weston_wm_destroy(struct weston_wm *wm)
>  {
> -	/* FIXME: Free windows in hash. */
> +	hash_table_for_each(wm->window_hash,
> +		weston_wm_window_destroy_iterator_func, NULL);

Please follow the coding convetion here.  The continuation line should
line up with the args above (like every other function call that's
broken over multiple lines).

>  	hash_table_destroy(wm->window_hash);
>  	xcb_disconnect(wm->conn);
>  	wl_event_source_remove(wm->source);
> -- 
> 1.7.9.5
> 
> _______________________________________________
> 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