wl_egl: close fence_fd when gsource finalized 94/295594/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Tue, 11 Jul 2023 06:33:48 +0000 (15:33 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Tue, 11 Jul 2023 09:35:16 +0000 (18:35 +0900)
commit8cac0af52e889a70a8ea2c4f0c08a13ca140d387
tree849a51faba50dd4fda3bf69d049e024f69942c41
parentf1be039aedd0c47aa9afe71404237f3de58b3fe4
wl_egl: close fence_fd when gsource finalized

 - Even though when main thread have called tpl_gsource_destroy for
  fence_waiting_source, which has not yet signaled, gsource may not be
  completely destroyed because it might be in dispatch queue in g_main_context.

 - In this case, if the fence_waiting_source is dispatched, it can try
  to commit with the invalid wl_egl_buffer that has already been freed.

 - This commit makes to prevent operating with an invalid wl_egl_buffer
  and to close fence_fd properly.

Change-Id: Ibce274b062bf8a6354a76464fca8f1e10b77c7b8
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_utils_gthread.c
src/tpl_wl_egl_thread.c