From 50c247dfdc512cdf341a030f1b1a4441ebc165ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 10 Jan 2022 13:23:31 +0200 Subject: [PATCH] mesa: free idalloc storage for display lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a leak: ==46154== 48 bytes in 1 blocks are definitely lost in loss record 1,571 of 1,905 ==46154== at 0x48466AF: realloc (vg_replace_malloc.c:1437) ==46154== by 0x5FC98EC: util_idalloc_resize (u_idalloc.c:43) ==46154== by 0x5FC9C16: util_idalloc_alloc_range (u_idalloc.c:125) ==46154== by 0x56FDB9F: _mesa_EndList (dlist.c:13681) Fixes: b703d7c15f4 ("dlist: store all dlist in a continuous memory block") Signed-off-by: Tapani Pälli Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: (cherry picked from commit 6e9cd801a65cdb2cefa3b3f261a93250e0267480) --- .pick_status.json | 2 +- src/mesa/main/shared.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 6b2956a25b9..de6ecf3fdb1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -499,7 +499,7 @@ "description": "mesa: free idalloc storage for display lists", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b703d7c15f47fed9f22de55f21cfd8d9d5ff241e" }, diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 9c6d2432370..9d7aad5fd67 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -357,6 +357,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) _mesa_HashDeleteAll(shared->DisplayList, delete_displaylist_cb, ctx); _mesa_DeleteHashTable(shared->DisplayList); free(shared->small_dlist_store.ptr); + util_idalloc_fini(&shared->small_dlist_store.free_idx); } if (shared->BitmapAtlas) {