From 3313f0f26dfcb90a91dbd6dc4a16a659f9372a7d Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 30 Nov 2016 10:19:40 -0600 Subject: [PATCH] Fix crash on xdg shell unbind Running weston-simple-dmabuf-intel and killing it could crash E in xdg_shell_unbind. --- src/modules/wl_desktop_shell/xdg6.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/modules/wl_desktop_shell/xdg6.c b/src/modules/wl_desktop_shell/xdg6.c index c6926e98e..b32338501 100644 --- a/src/modules/wl_desktop_shell/xdg6.c +++ b/src/modules/wl_desktop_shell/xdg6.c @@ -1336,11 +1336,14 @@ _e_xdg_shell_cb_unbind(struct wl_resource *resource) E_Client *ec = wl_resource_get_user_data(res); E_Shell_Data *shd; - if (ec->comp_data->shell.surface) - e_shell_surface_cb_destroy(ec->comp_data->shell.surface); - shd = ec->comp_data->shell.data; - if (shd) - e_shell_surface_cb_destroy(shd->surface); + if (!e_object_is_del(E_OBJECT(ec))) + { + if (ec->comp_data->shell.surface) + e_shell_surface_cb_destroy(ec->comp_data->shell.surface); + shd = ec->comp_data->shell.data; + if (shd) + e_shell_surface_cb_destroy(shd->surface); + } v->surfaces = eina_list_remove_list(v->surfaces, l); }