mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-26 00:24:35 +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,13 +9089,13 @@ void vmaFreeMemory(
|
|||||||
VmaAllocator allocator,
|
VmaAllocator allocator,
|
||||||
VmaAllocation allocation)
|
VmaAllocation allocation)
|
||||||
{
|
{
|
||||||
VMA_ASSERT(allocator && allocation);
|
VMA_ASSERT(allocator);
|
||||||
|
|
||||||
VMA_DEBUG_LOG("vmaFreeMemory");
|
VMA_DEBUG_LOG("vmaFreeMemory");
|
||||||
|
|
||||||
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||||
|
if(allocation != VK_NULL_HANDLE)
|
||||||
|
{
|
||||||
allocator->FreeMemory(allocation);
|
allocator->FreeMemory(allocation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void vmaGetAllocationInfo(
|
void vmaGetAllocationInfo(
|
||||||
@ -9303,16 +9303,15 @@ void vmaDestroyBuffer(
|
|||||||
VkBuffer buffer,
|
VkBuffer buffer,
|
||||||
VmaAllocation allocation)
|
VmaAllocation allocation)
|
||||||
{
|
{
|
||||||
|
VMA_ASSERT(allocator);
|
||||||
|
VMA_DEBUG_LOG("vmaDestroyBuffer");
|
||||||
|
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||||
if(buffer != VK_NULL_HANDLE)
|
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());
|
(*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks());
|
||||||
|
}
|
||||||
|
if(allocation != VK_NULL_HANDLE)
|
||||||
|
{
|
||||||
allocator->FreeMemory(allocation);
|
allocator->FreeMemory(allocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9379,16 +9378,15 @@ void vmaDestroyImage(
|
|||||||
VkImage image,
|
VkImage image,
|
||||||
VmaAllocation allocation)
|
VmaAllocation allocation)
|
||||||
{
|
{
|
||||||
|
VMA_ASSERT(allocator);
|
||||||
|
VMA_DEBUG_LOG("vmaDestroyImage");
|
||||||
|
VMA_DEBUG_GLOBAL_MUTEX_LOCK
|
||||||
if(image != VK_NULL_HANDLE)
|
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());
|
(*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks());
|
||||||
|
}
|
||||||
|
if(allocation != VK_NULL_HANDLE)
|
||||||
|
{
|
||||||
allocator->FreeMemory(allocation);
|
allocator->FreeMemory(allocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user