vulkan: Allow destroying NULL debug report callbacks
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 21 Apr 2020 16:29:21 +0000 (11:29 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 4 May 2020 14:06:27 +0000 (14:06 +0000)
Fixes: 086cfa5652 "anv: implementation of VK_EXT_debug_report extension"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4690>

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;