discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=2a9d4e73c5fce24fda93d1ff18610ec0cf1a8583

commit 2a9d4e73c5fce24fda93d1ff18610ec0cf1a8583
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Nov 29 11:08:46 2016 -0500

    correctly handle xdg surface deletion and pointer clearing
    
    fixes crashing/leaking when deleting surfaces
---
 src/modules/wl_desktop_shell/e_mod_main.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/modules/wl_desktop_shell/e_mod_main.c 
b/src/modules/wl_desktop_shell/e_mod_main.c
index c818b9f..5f10da9 100644
--- a/src/modules/wl_desktop_shell/e_mod_main.c
+++ b/src/modules/wl_desktop_shell/e_mod_main.c
@@ -24,19 +24,15 @@ e_shell_surface_destroy(struct wl_resource *resource)
         ec->comp_data->grab = 0;
      }
 
-   shd = ec->comp_data->shell.data;
 
+   if (resource == ec->comp_data->shell.surface)
+     ec->comp_data->shell.surface = NULL;
+   shd = ec->comp_data->shell.data;
    if (shd)
      {
         E_FREE_LIST(shd->pending, free);
-        if ((resource == ec->comp_data->shell.surface) || (resource == 
shd->surface))
-          {
-             if (ec->comp_data->shell.surface == resource)
-               ec->comp_data->shell.surface = NULL;
-             else
-               shd->surface = NULL;
-             E_FREE(ec->comp_data->shell.data);
-          }
+        if (resource == shd->surface)
+          E_FREE(ec->comp_data->shell.data);
      }
 
    if (ec->comp_data->mapped)

-- 


Reply via email to