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.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-12-07 12:18:28 -05:00
parent 33d0c8cdcf
commit 7469261d2f
1 changed files with 10 additions and 5 deletions

View File

@ -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);
}
}