From: Jason Ekstrand Date: Tue, 21 Apr 2020 16:29:21 +0000 (-0500) Subject: vulkan: Allow destroying NULL debug report callbacks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9d10bde5a878aac440ea34dfb304812cd00b231c;p=mesa.git 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: --- 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;