Vulkan: Fix DeviceObject not destroying previous object

This commit is contained in:
Lynix 2020-04-26 16:26:24 +02:00
parent 1c23949608
commit cbd81e3abf
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ namespace Nz
template<typename C, typename VkType, typename CreateInfo, VkObjectType ObjectType>
bool DeviceObject<C, VkType, CreateInfo, ObjectType>::Create(Device& device, const CreateInfo& createInfo, const VkAllocationCallbacks* allocator)
{
Destroy();
m_device = &device;
m_lastErrorCode = C::CreateHelper(*m_device, &createInfo, allocator, &m_handle);
if (m_lastErrorCode != VkResult::VK_SUCCESS)