From 60fd425cae689f46759cc15b2e91c9ea0c99bace Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 7 Apr 2023 17:14:08 -0400 Subject: [PATCH] zink: free GPL input/output libs on context destroy to avoid leaking cc: mesa-stable Part-of: (cherry picked from commit a81a101159f941d991b30a26315621fd7325427b) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index c3cea83c004..a4adfe0e54e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4244,7 +4244,7 @@ "description": "zink: free GPL input/output libs on context destroy to avoid leaking", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 9698f0e128b..cf522a84280 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -167,6 +167,14 @@ zink_context_destroy(struct pipe_context *pctx) zink_destroy_render_pass(screen, he->data); zink_context_destroy_query_pools(ctx); + set_foreach(&ctx->gfx_inputs, he) { + struct zink_gfx_input_key *ikey = (void*)he->key; + VKSCR(DestroyPipeline)(screen->dev, ikey->pipeline, NULL); + } + set_foreach(&ctx->gfx_outputs, he) { + struct zink_gfx_output_key *okey = (void*)he->key; + VKSCR(DestroyPipeline)(screen->dev, okey->pipeline, NULL); + } u_upload_destroy(pctx->stream_uploader); u_upload_destroy(pctx->const_uploader); slab_destroy_child(&ctx->transfer_pool);