mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-26 00:24:35 +00:00
Improvement in vmaCreateAllocator in case creation fails
This commit is contained in:
parent
cc61fe10d8
commit
dfa2051cd2
@ -16725,7 +16725,13 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(
|
|||||||
(VK_VERSION_MAJOR(pCreateInfo->vulkanApiVersion) == 1 && VK_VERSION_MINOR(pCreateInfo->vulkanApiVersion) <= 2));
|
(VK_VERSION_MAJOR(pCreateInfo->vulkanApiVersion) == 1 && VK_VERSION_MINOR(pCreateInfo->vulkanApiVersion) <= 2));
|
||||||
VMA_DEBUG_LOG("vmaCreateAllocator");
|
VMA_DEBUG_LOG("vmaCreateAllocator");
|
||||||
*pAllocator = vma_new(pCreateInfo->pAllocationCallbacks, VmaAllocator_T)(pCreateInfo);
|
*pAllocator = vma_new(pCreateInfo->pAllocationCallbacks, VmaAllocator_T)(pCreateInfo);
|
||||||
return (*pAllocator)->Init(pCreateInfo);
|
VkResult result = (*pAllocator)->Init(pCreateInfo);
|
||||||
|
if(result < 0)
|
||||||
|
{
|
||||||
|
vma_delete(pCreateInfo->pAllocationCallbacks, *pAllocator);
|
||||||
|
*pAllocator = VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
|
VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(
|
||||||
|
Loading…
Reference in New Issue
Block a user