anv: release memory allocated by bo_heap when descriptor pool is destroyed
authorTapani Pälli <tapani.palli@intel.com>
Fri, 8 Mar 2019 08:29:26 +0000 (10:29 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 11 Mar 2019 06:13:27 +0000 (08:13 +0200)
Fixes following leak:

   ==21853== 32 bytes in 1 blocks are definitely lost in loss record 2 of 20
   ==21853==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
   ==21853==    by 0x4C4DD7F: util_vma_heap_free (vma.c:221)
   ==21853==    by 0x4C4D647: util_vma_heap_init (vma.c:46)
   ==21853==    by 0x4957B9F: anv_CreateDescriptorPool (anv_descriptor_set.c:578)

Fixes: c520f4dec9cb ("anv: Add a concept of a descriptor buffer")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_descriptor_set.c

index 75ab643f47559f4f93ab9c49cd55851da96eac4d..f293cf469ee4b1969b0dc5827fa3f67ab6043b60 100644 (file)
@@ -614,6 +614,8 @@ void anv_DestroyDescriptorPool(
       anv_descriptor_set_destroy(device, pool, set);
    }
 
+   util_vma_heap_finish(&pool->bo_heap);
+
    vk_free2(&device->alloc, pAllocator, pool);
 }