summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_display.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index c38e383b5a..232bbfdc54 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -564,8 +564,6 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
564 Ecore_Wl2_Input *input; 564 Ecore_Wl2_Input *input;
565 Eina_Inlist *tmp; 565 Eina_Inlist *tmp;
566 566
567 if (--ewd->refs) return;
568
569 if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context); 567 if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
570 568
571 /* free each input */ 569 /* free each input */
@@ -809,7 +807,7 @@ ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
809{ 807{
810 EINA_SAFETY_ON_NULL_RETURN(display); 808 EINA_SAFETY_ON_NULL_RETURN(display);
811 809
812 _ecore_wl2_display_cleanup(display); 810 --display->refs;
813 if (display->refs == 0) 811 if (display->refs == 0)
814 { 812 {
815 wl_display_roundtrip(display->wl.display); 813 wl_display_roundtrip(display->wl.display);
@@ -818,6 +816,8 @@ ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
818 /* remove this client display from hash */ 816 /* remove this client display from hash */
819 eina_hash_del_by_key(_client_displays, display->name); 817 eina_hash_del_by_key(_client_displays, display->name);
820 818
819 _ecore_wl2_display_cleanup(display);
820
821 free(display->name); 821 free(display->name);
822 free(display); 822 free(display);
823 } 823 }
@@ -828,9 +828,13 @@ ecore_wl2_display_destroy(Ecore_Wl2_Display *display)
828{ 828{
829 EINA_SAFETY_ON_NULL_RETURN(display); 829 EINA_SAFETY_ON_NULL_RETURN(display);
830 830
831 _ecore_wl2_display_cleanup(display); 831 --display->refs;
832 if (display->refs == 0) 832 if (display->refs == 0)
833 { 833 {
834 /* this ensures that things like wl_registry are destroyed
835 * before we destroy the actual wl_display */
836 _ecore_wl2_display_cleanup(display);
837
834 wl_display_destroy(display->wl.display); 838 wl_display_destroy(display->wl.display);
835 839
836 /* remove this client display from hash */ 840 /* remove this client display from hash */