From 6ee0b4a51de2c59ce355f7a2d83cc842214f97ce Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 19 May 2016 09:04:01 +0200 Subject: [PATCH] Vulkan/CommandBuffer: Fix crash when moving Former-commit-id: 441095f5be1fc45dac4b56e1cf535c1145327d4b --- include/Nazara/Vulkan/VkCommandBuffer.inl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/Nazara/Vulkan/VkCommandBuffer.inl b/include/Nazara/Vulkan/VkCommandBuffer.inl index ff4eaede4..7e48901c2 100644 --- a/include/Nazara/Vulkan/VkCommandBuffer.inl +++ b/include/Nazara/Vulkan/VkCommandBuffer.inl @@ -33,7 +33,8 @@ namespace Nz inline void CommandBuffer::Free() { - m_pool->GetDevice().vkFreeCommandBuffers(m_pool->GetDevice(), *m_pool, 1, &m_handle); + if (m_handle) + m_pool->GetDevice().vkFreeCommandBuffers(m_pool->GetDevice(), *m_pool, 1, &m_handle); } inline VkResult CommandBuffer::GetLastErrorCode() const