From 50b2712f61d16550eadf7ae9c80d629b0bf687ea Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 29 Nov 2016 11:09:31 -0500 Subject: [PATCH] destroy xdg role surfaces if base surface is destroyed this is illegal, but at least we should not leak the client when it happens --- src/modules/wl_desktop_shell/xdg6.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/wl_desktop_shell/xdg6.c b/src/modules/wl_desktop_shell/xdg6.c index 7e5d8e1b5..45e4ab366 100644 --- a/src/modules/wl_desktop_shell/xdg6.c +++ b/src/modules/wl_desktop_shell/xdg6.c @@ -1217,6 +1217,12 @@ _e_xdg_shell_surface_cb_destroy(struct wl_resource *resource) if (e_object_is_del(E_OBJECT(ec))) return; + if (ec->comp_data->shell.surface) + { + wl_resource_post_error(resource, ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES, "shell surface destroyed before role surfaces"); + e_shell_surface_cb_destroy(ec->comp_data->shell.surface); + } + shd = ec->comp_data->shell.data; if (shd) ((v6_Shell_Data*)shd->shell)->surfaces = eina_list_remove(((v6_Shell_Data*)shd->shell)->surfaces, resource);