mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-10 02:31:48 +00:00
Fixed vmaDestroyBuffer, vmaDestroyImage, vmaFreeMemory for cases where allocation is null. #24 thanks @achienbsi !
This commit is contained in:
parent
4f91939dea
commit
6530fe3a38
@ -9089,14 +9089,14 @@ void vmaFreeMemory(
|
||||
VmaAllocator allocator,
|
||||
VmaAllocation allocation)
|
||||
{
|
||||
VMA_ASSERT(allocator && allocation);
|
||||
|
||||
VMA_ASSERT(allocator);
|
||||
VMA_DEBUG_LOG("vmaFreeMemory");
|
||||
|
||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||
|
||||
if(allocation != VK_NULL_HANDLE)
|
||||
{
|
||||
allocator->FreeMemory(allocation);
|
||||
}
|
||||
}
|
||||
|
||||
void vmaGetAllocationInfo(
|
||||
VmaAllocator allocator,
|
||||
@ -9303,16 +9303,15 @@ void vmaDestroyBuffer(
|
||||
VkBuffer buffer,
|
||||
VmaAllocation allocation)
|
||||
{
|
||||
VMA_ASSERT(allocator);
|
||||
VMA_DEBUG_LOG("vmaDestroyBuffer");
|
||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||
if(buffer != VK_NULL_HANDLE)
|
||||
{
|
||||
VMA_ASSERT(allocator);
|
||||
|
||||
VMA_DEBUG_LOG("vmaDestroyBuffer");
|
||||
|
||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||
|
||||
(*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks());
|
||||
|
||||
}
|
||||
if(allocation != VK_NULL_HANDLE)
|
||||
{
|
||||
allocator->FreeMemory(allocation);
|
||||
}
|
||||
}
|
||||
@ -9379,16 +9378,15 @@ void vmaDestroyImage(
|
||||
VkImage image,
|
||||
VmaAllocation allocation)
|
||||
{
|
||||
VMA_ASSERT(allocator);
|
||||
VMA_DEBUG_LOG("vmaDestroyImage");
|
||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||
if(image != VK_NULL_HANDLE)
|
||||
{
|
||||
VMA_ASSERT(allocator);
|
||||
|
||||
VMA_DEBUG_LOG("vmaDestroyImage");
|
||||
|
||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||
|
||||
(*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks());
|
||||
|
||||
}
|
||||
if(allocation != VK_NULL_HANDLE)
|
||||
{
|
||||
allocator->FreeMemory(allocation);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user