Enqueued tbm_surface is needed to unref when surface's finalize is called 88/298988/6
authorjinbong, Lee <jinbong.lee@samsung.com>
Mon, 18 Sep 2023 06:19:41 +0000 (15:19 +0900)
committerjinbong, Lee <jinbong.lee@samsung.com>
Mon, 18 Sep 2023 11:14:17 +0000 (20:14 +0900)
 - If main thread called __tpl_wl_egl_surface_fini(),
   then sometimes enqueued buffer can be remained before acquire.
   so in that case tbm_surface must be unreferenced.

Change-Id: I3482feca808deec9c238d5ca32ee46c9ebeec401

src/tpl_wl_egl_thread.c

index c927f6e..3a5fe4a 100755 (executable)
@@ -2194,7 +2194,7 @@ _tpl_wl_egl_surface_buffer_clear(tpl_wl_egl_surface_t *wl_egl_surface)
 
                tpl_gmutex_unlock(&wl_egl_buffer->mutex);
 
-               if (need_to_release || need_to_cancel)
+               if (need_to_release || need_to_cancel || status == ENQUEUED)
                        tbm_surface_internal_unref(wl_egl_buffer->tbm_surface);
        }