zink: free GPL input/output libs on context destroy to avoid leaking

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22397>
(cherry picked from commit a81a101159)
This commit is contained in:
Mike Blumenkrantz 2023-04-07 17:14:08 -04:00 committed by Dylan Baker
parent 78f9426f88
commit 60fd425cae
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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);