forked from enlightenment/efl
ecore-wl2: Ensure display cleanup after roundtrips
Commit ee52a28d04
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>
This commit is contained in:
parent
7359f0be6e
commit
c6b59be1da
|
@ -564,8 +564,6 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
|
||||||
Ecore_Wl2_Input *input;
|
Ecore_Wl2_Input *input;
|
||||||
Eina_Inlist *tmp;
|
Eina_Inlist *tmp;
|
||||||
|
|
||||||
if (--ewd->refs) return;
|
|
||||||
|
|
||||||
if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
|
if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
|
||||||
|
|
||||||
/* free each input */
|
/* free each input */
|
||||||
|
@ -809,7 +807,7 @@ ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(display);
|
EINA_SAFETY_ON_NULL_RETURN(display);
|
||||||
|
|
||||||
_ecore_wl2_display_cleanup(display);
|
--display->refs;
|
||||||
if (display->refs == 0)
|
if (display->refs == 0)
|
||||||
{
|
{
|
||||||
wl_display_roundtrip(display->wl.display);
|
wl_display_roundtrip(display->wl.display);
|
||||||
|
@ -818,6 +816,8 @@ ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
|
||||||
/* remove this client display from hash */
|
/* remove this client display from hash */
|
||||||
eina_hash_del_by_key(_client_displays, display->name);
|
eina_hash_del_by_key(_client_displays, display->name);
|
||||||
|
|
||||||
|
_ecore_wl2_display_cleanup(display);
|
||||||
|
|
||||||
free(display->name);
|
free(display->name);
|
||||||
free(display);
|
free(display);
|
||||||
}
|
}
|
||||||
|
@ -828,9 +828,13 @@ ecore_wl2_display_destroy(Ecore_Wl2_Display *display)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(display);
|
EINA_SAFETY_ON_NULL_RETURN(display);
|
||||||
|
|
||||||
_ecore_wl2_display_cleanup(display);
|
--display->refs;
|
||||||
if (display->refs == 0)
|
if (display->refs == 0)
|
||||||
{
|
{
|
||||||
|
/* this ensures that things like wl_registry are destroyed
|
||||||
|
* before we destroy the actual wl_display */
|
||||||
|
_ecore_wl2_display_cleanup(display);
|
||||||
|
|
||||||
wl_display_destroy(display->wl.display);
|
wl_display_destroy(display->wl.display);
|
||||||
|
|
||||||
/* remove this client display from hash */
|
/* remove this client display from hash */
|
||||||
|
|
Loading…
Reference in New Issue