Vulkan: Fix Destroy() method of object not resetting the internal pointer

Leading to double-delete if Delete() was explictly called


Former-commit-id: 0f42bc70913b64eb60193035ae15285fcc8c88ad [formerly 6d8b0e87e7b2edfb2052671a059863b3ce439fcc]
Former-commit-id: 2806bd83474c0c12fb88b9562b6baf71cc7692c1
This commit is contained in:
Lynix
2016-06-01 20:59:39 +02:00
parent c75f3ce28b
commit baa0dc3e3d
4 changed files with 11 additions and 0 deletions

View File

@@ -57,7 +57,10 @@ namespace Nz
inline void DeviceObject<C, VkType, CreateInfo>::Destroy()
{
if (m_handle != VK_NULL_HANDLE)
{
C::DestroyHelper(m_device, m_handle, (m_allocator.pfnAllocation) ? &m_allocator : nullptr);
m_handle = VK_NULL_HANDLE;
}
}
template<typename C, typename VkType, typename CreateInfo>