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

Tiago Vignatti tiago.vignatti at linux.intel.com
Wed Jul 18 04:58:05 PDT 2012


I think this's alright, but now I realize that we're missing to destroy 
the frame window all over the WM. Check for window->frame_id there.


Thanks,

Tiago

On 07/04/2012 12:10 AM, 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);
> +}
> +
> +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);
>   	hash_table_destroy(wm->window_hash);
>   	xcb_disconnect(wm->conn);
>   	wl_event_source_remove(wm->source);
>




More information about the wayland-devel mailing list