util/vma: Fix leak of the heap in the unit test.
authorEric Anholt <eric@anholt.net>
Fri, 4 Dec 2020 19:17:39 +0000 (11:17 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 15 Dec 2020 19:39:29 +0000 (19:39 +0000)
Needed for unit testing with asan enabled.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>

src/util/tests/vma/vma_random_test.cpp

index 9246176..44f25e4 100644 (file)
@@ -78,6 +78,11 @@ struct random_test {
       util_vma_heap_init(&heap, MEM_START_PAGE * MEM_PAGE_SIZE, MEM_SIZE);
    }
 
+   ~random_test()
+   {
+      util_vma_heap_finish(&heap);
+   }
+
    void test(unsigned long count)
    {
       std::uniform_int_distribution<> one_to_thousand(1, 1000);