From f4748bff59b21c51092a081df48d7d00f2bfbfef Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 15 Jul 2015 15:15:54 -0700 Subject: [PATCH] vk/device: Provide proper NULL handling in anv_device_free The Vulkan spec does not specify that the free function provided to CreateInstance must handle NULL properly so we do it in the wrapper. If this ever changes in the spec, we can delete the extra 2 lines. --- src/vulkan/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 2b8bcbe9e82..454e8f48f42 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -1057,6 +1057,9 @@ void anv_device_free(struct anv_device * device, void * mem) { + if (mem == NULL) + return; + return device->instance->pfnFree(device->instance->pAllocUserData, mem); } -- 2.30.2