vulkan: Allow destroying NULL debug report callbacks
[mesa.git] / src / vulkan / util / vk_debug_report.c
index c4884b963e052c59dda03a01a33943b2d10e8d55..78dcfa6e218e4a2fe33a0187fd36ee8dcd5eb844 100644 (file)
@@ -77,6 +77,9 @@ vk_destroy_debug_report_callback(struct vk_debug_report_instance *instance,
                                  const VkAllocationCallbacks* pAllocator,
                                  const VkAllocationCallbacks* instance_allocator)
 {
+   if (_callback == VK_NULL_HANDLE)
+      return;
+
    struct vk_debug_report_callback *callback =
             (struct vk_debug_report_callback *)(uintptr_t)_callback;