summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonbum Ko <joonbum.ko@samsung.com>2020-06-04 16:31:31 +0900
committerXuelian Bai <xuelian.bai@samsung.com>2024-01-18 09:31:50 +0800
commit6f7bcf7c1bd2e1e672a0d281f0bd7574e25af8aa (patch)
tree1516cfdfb20942e017c27e281de52159bf85c17e
parent8a12c9c3bb69dc379cf6c4d39f0f81ded1bbf4d6 (diff)
downloadmesa-6f7bcf7c1bd2e1e672a0d281f0bd7574e25af8aa.tar.gz
mesa-6f7bcf7c1bd2e1e672a0d281f0bd7574e25af8aa.tar.bz2
mesa-6f7bcf7c1bd2e1e672a0d281f0bd7574e25af8aa.zip
fixed fd leak problem.
Change-Id: I59e0b8c42f280582b0c0c25b2963786a3a5404d1 Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
-rwxr-xr-xsrc/egl/drivers/dri2/platform_tizen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index 6922b55a2d2..a3a2b67f7ad 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;
}