zink: destroy descriptor pools on context destroy
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 3 Jun 2020 15:13:35 +0000 (11:13 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sat, 18 Jul 2020 07:51:37 +0000 (07:51 +0000)
this is a big leak

Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5887>

src/gallium/drivers/zink/zink_context.c

index a9cbd929e4a1fea128d4db0d824d3d3e8f8c569d..792027ceb93ef7b84fe7cad24e90ff6206e46259 100644 (file)
@@ -61,8 +61,10 @@ zink_context_destroy(struct pipe_context *pctx)
    for (unsigned i = 0; i < ARRAY_SIZE(ctx->null_buffers); i++)
       pipe_resource_reference(&ctx->null_buffers[i], NULL);
 
-   for (int i = 0; i < ARRAY_SIZE(ctx->batches); ++i)
+   for (int i = 0; i < ARRAY_SIZE(ctx->batches); ++i) {
+      vkDestroyDescriptorPool(screen->dev, ctx->batches[i].descpool, NULL);
       vkFreeCommandBuffers(screen->dev, ctx->cmdpool, 1, &ctx->batches[i].cmdbuf);
+   }
    vkDestroyCommandPool(screen->dev, ctx->cmdpool, NULL);
 
    util_primconvert_destroy(ctx->primconvert);