From 8986b7f9aec39313016c5b8d876bb01b8f3315dc 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: (cherry picked from commit 2f34a1db5883a2e5178371d8295f711bd754a1e1) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 9540226d76b..81fcd593d0a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -264,7 +264,7 @@ "description": "zink: deallocate global_bindings array", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "a6e9e0f0d771e5121ea477cbaabe65a38de0ce5d", "notes": null diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index f8e742fc9cf..39494ad1a14 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); } -- 2.34.1