zink: free resource objects' views array during destruction

since the array is not ralloc managed, it has be explicitly freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
(cherry picked from commit 96849363eb)
This commit is contained in:
SoroushIMG 2023-02-13 14:38:26 +00:00 committed by Eric Engestrom
parent 840e0b9410
commit 9ed54537c4
2 changed files with 2 additions and 1 deletions

View file

@ -283,7 +283,7 @@
"description": "zink: free resource objects' views array during destruction",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -105,6 +105,7 @@ zink_destroy_resource_object(struct zink_screen *screen, struct zink_resource_ob
while (util_dynarray_contains(&obj->views, VkImageView))
VKSCR(DestroyImageView)(screen->dev, util_dynarray_pop(&obj->views, VkImageView), NULL);
}
util_dynarray_fini(&obj->views);
if (obj->is_buffer) {
VKSCR(DestroyBuffer)(screen->dev, obj->buffer, NULL);
VKSCR(DestroyBuffer)(screen->dev, obj->storage_buffer, NULL);