[PATCH wayland] client: Check that the proxy object exists before invoking closure

David Herrmann dh.herrmann at googlemail.com
Sun Oct 28 00:01:23 PDT 2012


Hi Jonas

On Sun, Oct 28, 2012 at 12:45 AM, Jonas Ådahl <jadahl at gmail.com> wrote:
> Even when a closure got queued in the queue of a proxy, the proxy object
> can be destroyed during a closure invoke earlier in the queue. Therefore
> check that the proxy object still exists before invoking a closure.
>
> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
> ---

Yes, that patch looks alright. We either need to delete all objects
from each queue during object-deletion or use your approach. And I am
all in favor of your approach as it is a lot simpler.

Regards
David

>
>  src/wayland-client.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/wayland-client.c b/src/wayland-client.c
> index 7e50b40..155a5b7 100644
> --- a/src/wayland-client.c
> +++ b/src/wayland-client.c
> @@ -740,7 +740,7 @@ dispatch_event(struct wl_display *display, struct wl_event_queue *queue)
>
>         pthread_mutex_unlock(&display->mutex);
>
> -       if (proxy != WL_ZOMBIE_OBJECT &&
> +       if (proxy && proxy != WL_ZOMBIE_OBJECT &&
>             proxy->object.implementation && ret == 0) {
>                 if (wl_debug)
>                         wl_closure_print(closure, &proxy->object, false);
> --
> 1.7.10.4
>
> _______________________________________________
> 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