Fix fence fd leak issue:
authornith1989 <tianhao.ni@samsung.com>
Thu, 18 Mar 2021 06:57:08 +0000 (14:57 +0800)
committerXuelian Bai <xuelian.bai@samsung.com>
Thu, 18 Jan 2024 01:31:55 +0000 (09:31 +0800)
- close fence fd when destroy context

Change-Id: I4ec1fe1c2f7de3221802ea53c3e563471cd1a332
Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
src/gallium/drivers/v3d/v3d_context.c

index 1fa7295b32628564bcf70dcf5497a0be0bf52c25..90f4719eed3633aa2b261e0bfc9d2dd5f0321072 100644 (file)
@@ -292,6 +292,13 @@ v3d_context_destroy(struct pipe_context *pctx)
 
         v3d_program_fini(pctx);
 
+        if (v3d->screen->has_syncobj) {
+                drmSyncobjDestroy(v3d->fd, v3d->out_sync);
+                drmSyncobjDestroy(v3d->fd, v3d->in_syncobj);
+        }
+        if (v3d->in_fence_fd >= 0)
+                close(v3d->in_fence_fd);
+
         ralloc_free(v3d);
 }