From 2463ce8b4349199102bc3f7281ff8c3400732d5a Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 15 Jun 2016 15:19:32 -0500 Subject: [PATCH] Fix crash in wl_shell surface destroy wl_shell doesn't set up shell.data, but this destructor is shared with xdg_shell which does. --- src/modules/wl_desktop_shell/e_mod_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c index f599acaaa..6c0a05e8f 100644 --- a/src/modules/wl_desktop_shell/e_mod_main.c +++ b/src/modules/wl_desktop_shell/e_mod_main.c @@ -135,8 +135,12 @@ _e_shell_surface_destroy(struct wl_resource *resource) { E_Shell_Data *shd = ec->comp_data->shell.data; - E_FREE_LIST(shd->pending, free); - E_FREE(ec->comp_data->shell.data); + if (shd) + { + E_FREE_LIST(shd->pending, free); + E_FREE(ec->comp_data->shell.data); + } + if (ec->comp_data->mapped) { if ((ec->comp_data->shell.surface) &&