clean up xwl data on client deletion
authorMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 30 Jun 2015 22:38:01 +0000 (18:38 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 30 Jun 2015 22:38:01 +0000 (18:38 -0400)
remove the extra comp_data, the pending client list entry, and the pixmap ref

src/bin/e_comp_wl.h
src/bin/e_comp_x.c

index f0bc175..f094c8e 100644 (file)
@@ -322,9 +322,13 @@ e_comp_wl_client_xwayland_pixmap(const E_Client *ec)
 static inline void
 e_comp_wl_client_xwayland_setup(E_Client *ec, E_Comp_X_Client_Data *cd, E_Pixmap *ep)
 {
-   ((E_Comp_Wl_Client_Data*)ec->comp_data)->xwayland_data = cd;
-   ((E_Comp_Wl_Client_Data*)ec->comp_data)->xwayland_pixmap = ep;
-   e_comp->wl_comp_data->xwl_pending = eina_list_remove(e_comp->wl_comp_data->xwl_pending, ec);
+   if (cd && ep)
+     {
+        ((E_Comp_Wl_Client_Data*)ec->comp_data)->xwayland_data = cd;
+        ((E_Comp_Wl_Client_Data*)ec->comp_data)->xwayland_pixmap = ep;
+     }
+   if (e_comp->wl_comp_data->xwl_pending)
+     e_comp->wl_comp_data->xwl_pending = eina_list_remove(e_comp->wl_comp_data->xwl_pending, ec);
 }
 #  endif
 # endif
index fad1b53..49ef0a1 100644 (file)
@@ -4366,6 +4366,15 @@ _e_comp_x_hook_client_del(void *d EINA_UNUSED, E_Client *ec)
      }
    if (cd)
      E_FREE_FUNC(cd->first_draw_delay, ecore_timer_del);
+#ifdef HAVE_WAYLAND
+   if (e_pixmap_is_x(ec->pixmap))
+     e_comp_wl_client_xwayland_setup(ec, NULL, NULL);
+   else
+     {
+        free(cd);
+        e_pixmap_free(_e_comp_x_client_pixmap_get(ec));
+     }
+#endif
    if (post_clients)
      post_clients = eina_list_remove(post_clients, ec);