From 2eb262be539ebe1125c5a57411db3a6047d5370b Mon Sep 17 00:00:00 2001 From: Woochanlee Date: Wed, 23 Sep 2020 17:05:22 +0900 Subject: [PATCH] wayland_shm: Check tbm_client validation. In certain use case, the tbm_client has been deinited when _evas_outbuf_redraws_clear called. It cause crash. Change-Id: Ibdc75b3cf66a541e5ac5568e604c54a137f2eb8d --- .../ecore_evas/engines/wayland/ecore_evas_wayland_common.c | 5 ++++- src/modules/evas/engines/wayland_shm/evas_outbuf.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 8466320799..31ae764652 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -3256,7 +3256,10 @@ _ecore_evas_wl_common_evas_engine_rsc_free(Ecore_Evas *ee) if (einfo && einfo->info.tbm_client) { if (_ecore_evas_wl_init_count == 1) - wayland_tbm_client_deinit(einfo->info.tbm_client); + { + wayland_tbm_client_deinit(einfo->info.tbm_client); + einfo->info.tbm_client = NULL; + } } } } diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c index e520f9c823..73564b45dd 100755 --- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c @@ -519,7 +519,8 @@ _evas_outbuf_redraws_clear(Outbuf *ob) wls = ecore_wl2_window_surface_get(ob->info->info.wl2_win); if (wls) { - ecore_wl2_surface_set_serial(ob->surface, ob->info->info.serial); + if (ob->info->info.tbm_client) + ecore_wl2_surface_set_serial(ob->surface, ob->info->info.serial); ecore_wl2_surface_post(ob->surface, ob->priv.rects, ob->priv.rect_count); } -- 2.34.1