From 6f7bcf7c1bd2e1e672a0d281f0bd7574e25af8aa Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 4 Jun 2020 16:31:31 +0900 Subject: [PATCH] fixed fd leak problem. Change-Id: I59e0b8c42f280582b0c0c25b2963786a3a5404d1 Signed-off-by: Joonbum Ko --- src/egl/drivers/dri2/platform_tizen.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c index 6922b55..a3a2b67 100755 --- a/src/egl/drivers/dri2/platform_tizen.c +++ b/src/egl/drivers/dri2/platform_tizen.c @@ -186,6 +186,7 @@ tizen_internal_wait_sync_for_release_fence(struct dri2_egl_surface *dri2_surf, dri2_sync = calloc(1, sizeof(struct dri2_egl_sync)); if (!dri2_sync) { + close(release_fence_fd); return EGL_FALSE; } @@ -193,6 +194,7 @@ tizen_internal_wait_sync_for_release_fence(struct dri2_egl_surface *dri2_surf, EGL_SYNC_NATIVE_FENCE_TIZEN, attrib_list)) { free(dri2_sync); + close(release_fence_fd); return EGL_FALSE; } @@ -204,16 +206,14 @@ tizen_internal_wait_sync_for_release_fence(struct dri2_egl_surface *dri2_surf, if (!dri2_sync->fence) { free(dri2_sync); + close(release_fence_fd); return EGL_FALSE; } - if (p_atomic_dec_zero(&dri2_sync->refcount)) { - close(dri2_sync->base.SyncFd); - - if (dri2_sync->fence) - dri2_dpy->fence->destroy_fence(dri2_dpy->dri_screen, dri2_sync->fence); - free(dri2_sync); - } + close(dri2_sync->base.SyncFd); + if (dri2_sync->fence) + dri2_dpy->fence->destroy_fence(dri2_dpy->dri_screen_render_gpu, dri2_sync->fence); + free(dri2_sync); return EGL_TRUE; } -- 2.7.4