mirror of https://github.com/cemu-project/Cemu.git
Vulkan: Manage ownership of memory manager with unique_ptr
This commit is contained in:
parent
4581281a19
commit
d6a5693aa0
|
@ -439,7 +439,7 @@ VulkanRenderer::VulkanRenderer()
|
|||
GetDeviceFeatures();
|
||||
|
||||
// init memory manager
|
||||
memoryManager = new VKRMemoryManager(this);
|
||||
memoryManager.reset(new VKRMemoryManager(this));
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -679,6 +679,9 @@ VulkanRenderer::~VulkanRenderer()
|
|||
vkDestroyDebugUtilsMessengerEXT(m_instance, m_debugCallback, nullptr);
|
||||
}
|
||||
|
||||
// destroy memory manager
|
||||
memoryManager.reset();
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
|
|
@ -137,8 +137,8 @@ class VulkanRenderer : public Renderer
|
|||
public:
|
||||
|
||||
// memory management
|
||||
VKRMemoryManager* memoryManager{};
|
||||
VKRMemoryManager* GetMemoryManager() const { return memoryManager; };
|
||||
std::unique_ptr<VKRMemoryManager> memoryManager;
|
||||
const std::unique_ptr<VKRMemoryManager>& GetMemoryManager() const { return memoryManager; };
|
||||
|
||||
VkSupportedFormatInfo_t m_supportedFormatInfo;
|
||||
|
||||
|
|
Loading…
Reference in New Issue