vk/device: Free border color states when we have valgrind
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Jun 2015 18:41:31 +0000 (11:41 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Jun 2015 19:36:23 +0000 (12:36 -0700)
src/vulkan/device.c

index 843c1ed61f0738ce827987bae4152151a51e56d2..37449d7ae4fbabca43d135f1c0ee6d9483a5ff8d 100644 (file)
@@ -412,6 +412,16 @@ VkResult anv_DestroyDevice(
 
    anv_device_finish_meta(device);
 
+#ifdef HAVE_VALGRIND
+   /* We only need to free these to prevent valgrind errors.  The backing
+    * BO will go away in a couple of lines so we don't actually leak.
+    */
+   anv_state_pool_free(&device->dynamic_state_pool,
+                       device->float_border_colors);
+   anv_state_pool_free(&device->dynamic_state_pool,
+                       device->uint32_border_colors);
+#endif
+
    anv_bo_pool_finish(&device->batch_bo_pool);
    anv_block_pool_finish(&device->dynamic_state_block_pool);
    anv_block_pool_finish(&device->instruction_block_pool);