mirror of https://github.com/cemu-project/Cemu.git
Properly handle resource clean up
This commit is contained in:
parent
e97493b2a1
commit
d59e17b105
|
@ -336,7 +336,9 @@ VKRBuffer::~VKRBuffer()
|
|||
{
|
||||
if (m_mappedMemory)
|
||||
vkUnmapMemory(VulkanRenderer::GetInstance()->GetLogicalDevice(), m_bufferMemory);
|
||||
if (m_bufferMemory != VK_NULL_HANDLE)
|
||||
vkFreeMemory(VulkanRenderer::GetInstance()->GetLogicalDevice(), m_bufferMemory, nullptr);
|
||||
if (m_buffer != VK_NULL_HANDLE)
|
||||
vkDestroyBuffer(VulkanRenderer::GetInstance()->GetLogicalDevice(), m_buffer, nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -679,6 +679,9 @@ VulkanRenderer::~VulkanRenderer()
|
|||
vkDestroyDebugUtilsMessengerEXT(m_instance, m_debugCallback, nullptr);
|
||||
}
|
||||
|
||||
// destroy memory manager
|
||||
delete memoryManager;
|
||||
|
||||
// destroy instance, devices
|
||||
if (m_instance != VK_NULL_HANDLE)
|
||||
{
|
||||
|
@ -690,9 +693,6 @@ VulkanRenderer::~VulkanRenderer()
|
|||
vkDestroyInstance(m_instance, nullptr);
|
||||
}
|
||||
|
||||
// destroy memory manager
|
||||
delete memoryManager;
|
||||
|
||||
// crashes?
|
||||
//glslang::FinalizeProcess();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue