From 2f34a1db5883a2e5178371d8295f711bd754a1e1 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Fri, 27 Oct 2023 15:53:19 +0200 Subject: [PATCH] zink: deallocate global_bindings array Fixes: a6e9e0f0d77 ("zink: add set_global_binding") Signed-off-by: Karol Herbst Acked-by: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 4c1f18e22f2..52c1bcf76cc 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -231,6 +231,11 @@ zink_context_destroy(struct pipe_context *pctx) if (!(ctx->flags & ZINK_CONTEXT_COPY_ONLY)) p_atomic_dec(&screen->base.num_contexts); + util_dynarray_foreach(&ctx->di.global_bindings, struct pipe_resource *, res) { + pipe_resource_reference(res, NULL); + } + util_dynarray_fini(&ctx->di.global_bindings); + ralloc_free(ctx); }