From 9d10bde5a878aac440ea34dfb304812cd00b231c Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 21 Apr 2020 11:29:21 -0500 Subject: [PATCH] vulkan: Allow destroying NULL debug report callbacks Fixes: 086cfa5652 "anv: implementation of VK_EXT_debug_report extension" Reviewed-by: Lionel Landwerlin Acked-by: Kristian H. Kristensen Acked-by: Bas Nieuwenhuizen Reviewed-by: Samuel Pitoiset Part-of: --- src/vulkan/util/vk_debug_report.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vulkan/util/vk_debug_report.c b/src/vulkan/util/vk_debug_report.c index c4884b963e0..78dcfa6e218 100644 --- a/src/vulkan/util/vk_debug_report.c +++ b/src/vulkan/util/vk_debug_report.c @@ -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; -- 2.30.2