devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7469261d2ff65cccccf3a418deaf7cd73d9a0f69

commit 7469261d2ff65cccccf3a418deaf7cd73d9a0f69
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Dec 7 12:18:28 2015 -0500

    ecore-wl2: Fix issue of cleanup function always removing from client
    display hash
    
    As the cleanup function is a generic helper to cleanup things in the
    Ecore_Wl2_Display structure, we cannot always just explicitly the
    display from the client_displays hash.
    
    The removal from the appropriate hashes should be done by the calling
    function(s) (ecore_wl2_display_disconnect for clients, and
    ecore_wl2_display_destroy for servers)
    
    @fix
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/ecore_wl2_display.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index 6f5abfb..ceb6f10 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -358,11 +358,6 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
    if (ewd->wl.registry) wl_registry_destroy(ewd->wl.registry);
 
    wl_display_flush(ewd->wl.display);
-
-   /* remove this client display from hash */
-   eina_hash_del_by_key(_client_displays, ewd->name);
-
-   free(ewd->name);
 }
 
 Ecore_Wl2_Window *
@@ -650,6 +645,11 @@ ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
    if (display->refs <= 0)
      {
         wl_display_disconnect(display->wl.display);
+
+        /* remove this client display from hash */
+        eina_hash_del_by_key(_client_displays, display->name);
+
+        free(display->name);
         free(display);
      }
 }
@@ -662,6 +662,11 @@ ecore_wl2_display_destroy(Ecore_Wl2_Display *display)
    if (display->refs <= 0)
      {
         wl_display_destroy(display->wl.display);
+
+        /* remove this client display from hash */
+        eina_hash_del_by_key(_server_displays, display->name);
+
+        free(display->name);
         free(display);
      }
 }

-- 


Reply via email to