st/interop: fix fence leak

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14050
Fixes: 1396dc1c38 ("mesa/st, dri2, wgl, glx: Modify flush_objects interop func to export a fence_fd")
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
(cherry picked from commit 87550fc657)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38432>
This commit is contained in:
Karol Herbst 2025-11-07 17:40:44 +01:00 committed by Dylan Baker
parent e334938384
commit 263e1823d2
2 changed files with 2 additions and 1 deletions

View file

@ -1684,7 +1684,7 @@
"description": "st/interop: fix fence leak",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "1396dc1c387a9f9a8b16ad358ee12a025159cc98",
"notes": null

View file

@ -437,6 +437,7 @@ st_interop_flush_objects(struct st_context *st,
struct pipe_fence_handle *fence = NULL;
ctx->pipe->flush(ctx->pipe, &fence, PIPE_FLUSH_FENCE_FD | PIPE_FLUSH_ASYNC);
*out->fence_fd = ctx->screen->fence_get_fd(ctx->screen, fence);
ctx->screen->fence_reference(ctx->screen, &fence, NULL);
}
out->version = MIN2(out->version, 1);
} else {