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>
Tue, 21 Feb 2023 06:32:53 +0000 (14:32 +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 edcfc9a..4821624 100644 (file)
@@ -296,6 +296,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);
 }