From 68ad159f0d688b863580082a452913d2b0667cec Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Wed, 7 Feb 2018 14:40:26 +0900 Subject: [PATCH] evas_tbmbuf: check that tbm_surface is already released Change-Id: I45cb57deb5f5d3de2d9eab73d0b7c10b3b311217 --- src/lib/ecore_wl2/ecore_wl2_tbmsurface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_tbmsurface.c b/src/lib/ecore_wl2/ecore_wl2_tbmsurface.c index 48a5f8d..0615f1b 100755 --- a/src/lib/ecore_wl2/ecore_wl2_tbmsurface.c +++ b/src/lib/ecore_wl2/ecore_wl2_tbmsurface.c @@ -95,13 +95,18 @@ buffer_release(void *data, struct wl_buffer *buffer EINA_UNUSED) if (!data) return; void *tbm_queue = NULL; tbm_surface_h tbm_surface = data; + tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE; + tbm_surface_internal_get_user_data(tbm_surface, KEY_WINDOW, (void **)&tbm_queue); - tbm_surface_internal_unref(tbm_surface); if (tbm_queue) { ERR("tbm_surface_queue_release"); - tbm_surface_queue_release(tbm_queue, tbm_surface); + tsq_err = tbm_surface_queue_release(tbm_queue, tbm_surface); + if (tsq_err != TBM_SURFACE_QUEUE_ERROR_ALREADY_EXIST) + tbm_surface_internal_unref(tbm_surface); } + else + tbm_surface_internal_unref(tbm_surface); } static void -- 2.7.4