Module: Mesa
Branch: master
Commit: 81be8c7049423c0b5c4abd51bac7bf7a6d57b678
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=81be8c7049423c0b5c4abd51bac7bf7a6d57b678

Author: Erik Faye-Lund <[email protected]>
Date:   Tue Dec 15 10:41:03 2020 +0100

zink: free sets and hash-tables in context

Up until now, we've simply leaked all of these. Let's try to do better.

Reviewed-By: Mike Blumenkrantz <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8099>

---

 src/gallium/drivers/zink/zink_context.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index a4c38d04e1e..0faac2de45b 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -70,12 +70,18 @@ zink_context_destroy(struct pipe_context *pctx)
       util_dynarray_fini(&ctx->batches[i].zombie_samplers);
       vkDestroyDescriptorPool(screen->dev, ctx->batches[i].descpool, NULL);
       vkFreeCommandBuffers(screen->dev, ctx->cmdpool, 1, 
&ctx->batches[i].cmdbuf);
+
+      _mesa_set_destroy(ctx->batches[i].resources, NULL);
+      _mesa_set_destroy(ctx->batches[i].sampler_views, NULL);
+      _mesa_set_destroy(ctx->batches[i].programs, NULL);
    }
    vkDestroyCommandPool(screen->dev, ctx->cmdpool, NULL);
 
    util_primconvert_destroy(ctx->primconvert);
    u_upload_destroy(pctx->stream_uploader);
    slab_destroy_child(&ctx->transfer_pool);
+   _mesa_hash_table_destroy(ctx->program_cache, NULL);
+   _mesa_hash_table_destroy(ctx->render_pass_cache, NULL);
    FREE(ctx);
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to