devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=93ea0b172cc8c351372add9611ca0423913e8f9f

commit 93ea0b172cc8c351372add9611ca0423913e8f9f
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Thu Aug 20 10:51:57 2015 -0400

    ecore-wl2: Add internal function to cleanup Ecore_Wl2_Display when closed
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/ecore_wl2_display.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index 0c7d4d8..89baebe 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -184,6 +184,18 @@ _cb_globals_hash_del(void *data)
    free(global);
 }
 
+static void
+_ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
+{
+   if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
+
+   wl_registry_destroy(wl_display_get_registry(ewd->wl.display));
+
+   if (ewd->fd_hdl) ecore_main_fd_handler_del(ewd->fd_hdl);
+
+   eina_hash_free(ewd->globals);
+}
+
 EAPI Ecore_Wl2_Display *
 ecore_wl2_display_create(const char *name)
 {
@@ -299,6 +311,7 @@ EAPI void
 ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
 {
    EINA_SAFETY_ON_NULL_RETURN(display);
+   _ecore_wl2_display_cleanup(display);
    wl_display_disconnect(display->wl.display);
 }
 
@@ -306,6 +319,7 @@ EAPI void
 ecore_wl2_display_destroy(Ecore_Wl2_Display *display)
 {
    EINA_SAFETY_ON_NULL_RETURN(display);
+   _ecore_wl2_display_cleanup(display);
    wl_display_destroy(display->wl.display);
 }
 

-- 


Reply via email to