From 5736f4e19f483032472df012712d1cb8b723c973 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Wed, 24 May 2023 15:17:46 +0200 Subject: [PATCH] paintable: Properly close DMABuf FD As g_unix_fd_list_get will dup the FD, we must close it once we are done with it. The issue went unnoticable during my testing as apprently, the max number of open FDs is not in sync between host & toolbox and that is annoying podman issue... --- lib/mks-paintable.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/mks-paintable.c b/lib/mks-paintable.c index 614867d..e030a0f 100644 --- a/lib/mks-paintable.c +++ b/lib/mks-paintable.c @@ -374,6 +374,9 @@ mks_paintable_listener_scanout_dmabuf (MksPaintable *self, scanout_data->stride = stride; scanout_data->fourcc = fourcc; scanout_data->modifier = modifier; + if (self->scanout_data) + g_clear_fd (&self->scanout_data->dmabuf_fd, NULL); + g_clear_pointer (&self->scanout_data, g_free); self->scanout_data = scanout_data;