summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-03-01 08:32:18 -0500
committerChris Michael <cp.michael@samsung.com>2017-03-01 08:32:18 -0500
commitc6b59be1da0bf9a3c667f63e82ec4a2ad64f0e9e (patch)
treec5ff373f38e57999a9ff806249434d53e8f9c94d /src
parent7359f0be6e80c818ea3067671fb5c84af5ec9aae (diff)
ecore-wl2: Ensure display cleanup after roundtrips
Commit ee52a28d041dfb02da0f2deca0714beb5eaa51fd added a roundtrip to ensure and pending wl events were handled before we disconnected the display. While this ensures some things like session recovery destroy work again, it lead to an issue where the _ecore_wl2_display_cleanup function was called BEFORE we processed pending events. This (in turn) causes crashes due to processing of pending events that relied on things like Ecore_Wl2_Input existing. As the display cleanup function clears inputs & outputs, we need to defer calling that until the display_roundtrip has dispatched and handled pending events. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src')
-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 */