Module: Mesa Branch: main Commit: 2f34a1db5883a2e5178371d8295f711bd754a1e1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2f34a1db5883a2e5178371d8295f711bd754a1e1
Author: Karol Herbst <kher...@redhat.com> Date: Fri Oct 27 15:53:19 2023 +0200 zink: deallocate global_bindings array Fixes: a6e9e0f0d77 ("zink: add set_global_binding") Signed-off-by: Karol Herbst <kher...@redhat.com> Acked-by: Mike Blumenkrantz <michael.blumenkra...@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937> --- 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); }