From c0c1497f999cea4d488ed334636b00b227fdca13 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 11 Sep 2015 14:30:39 -0500 Subject: [PATCH] shell: Make sure we actually have a resource in end_busy_cursor It's actually possible to get here after the surface has been destroyed, especially when running client apps under valgrind. That probably shouldn't be able to segfault the compositor. Signed-off-by: Derek Foreman Reviewed-by: Bryce Harrington --- desktop-shell/shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 034d39b..ecc42c5 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2119,6 +2119,7 @@ end_busy_cursor(struct weston_compositor *compositor, struct wl_client *client) grab = (struct shell_grab *) pointer->grab; if (grab->grab.interface == &busy_cursor_grab_interface && + grab->shsurf->resource && wl_resource_get_client(grab->shsurf->resource) == client) { shell_grab_end(grab); free(grab); -- 2.7.4