devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=7ace049cfbc53cee52b9631782f9aeac6a4e11aa

commit 7ace049cfbc53cee52b9631782f9aeac6a4e11aa
Author: Chris Michael <[email protected]>
Date:   Wed Oct 15 02:47:56 2014 -0400

    unset pixmap resource when surface resource is destroyed
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/bin/e_comp_wl.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index f1f764e..e03fa11 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -6,6 +6,12 @@
 #define E_COMP_WL_PIXMAP_CHECK \
    if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return
 
+/* Resource Data Mapping: (wl_resource_user_data_get)
+ * 
+ * wl_surface == e_pixmap
+ * 
+ */
+
 /* local functions */
 static void 
 _e_comp_wl_log_cb_print(const char *format, va_list args)
@@ -67,6 +73,13 @@ _e_comp_wl_cb_module_idle(void *data)
 static void 
 _e_comp_wl_surface_cb_destroy(struct wl_client *client EINA_UNUSED, struct 
wl_resource *resource)
 {
+   E_Pixmap *ep;
+
+   /* unset the pixmap resource */
+   if ((ep = wl_resource_user_data_get(resource)))
+     e_pixmap_resource_set(ep, NULL);
+
+   /* destroy this resource */
    wl_resource_destroy(resource);
 }
 
@@ -153,15 +166,13 @@ _e_comp_wl_compositor_cb_surface_create(struct wl_client 
*client, struct wl_reso
         return;
      }
 
+   DBG("\tCreated Resource: %d", wl_resource_get_id(res));
+
    /* FIXME: set callback ? */
    /* set implementation on resource */
    wl_resource_set_implementation(res, &_e_surface_interface, NULL, NULL);
 //                                  _callback);
 
-   DBG("\tCreated Resource: %d", wl_resource_get_id(res));
-
-   /* set implementation */
-
    /* get the client pid and generate a pixmap id */
    wl_client_get_credentials(client, &pid, NULL, NULL);
    wid = e_comp_wl_id_get(pid, id);

-- 


Reply via email to