mesa: fix refcnt imbalance related to _mesa_delete_semaphore_object()

Indeed, the fence reference was not freed.

For instance, this issue is triggered with
"piglit/bin/ext_external_objects-vk-semaphores-2 -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 7b6cd912a5 ("mesa/st: get rid of ST_CALLOC_STRUCT use CALLOC_STRUCT")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23296>
(cherry picked from commit 84f465ec81)
This commit is contained in:
Patrick Lerda 2023-05-25 16:15:28 +02:00 committed by Eric Engestrom
parent 499cac9c46
commit d3f47768bc
2 changed files with 5 additions and 2 deletions

View file

@ -1678,7 +1678,7 @@
"description": "mesa: fix refcnt imbalance related to _mesa_delete_semaphore_object()",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "7b6cd912a59a63e8d479970137b706cb38bede02"
},

View file

@ -754,8 +754,11 @@ void
_mesa_delete_semaphore_object(struct gl_context *ctx,
struct gl_semaphore_object *semObj)
{
if (semObj != &DummySemaphoreObject)
if (semObj != &DummySemaphoreObject) {
struct pipe_context *pipe = ctx->pipe;
pipe->screen->fence_reference(ctx->screen, &semObj->fence, NULL);
FREE(semObj);
}
}
void GLAPIENTRY