mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 22:11:18 +12:00
fix: memory leaks
This commit is contained in:
parent
fe3b84b4a7
commit
fa53af54db
5 changed files with 38 additions and 11 deletions
|
@ -3,6 +3,14 @@
|
|||
|
||||
const size_t BUFFER_ALLOCATION_SIZE = 8 * 1024 * 1024;
|
||||
|
||||
MetalBufferAllocator::~MetalBufferAllocator()
|
||||
{
|
||||
for (auto buffer : m_buffers)
|
||||
{
|
||||
buffer->release();
|
||||
}
|
||||
}
|
||||
|
||||
MetalBufferAllocation MetalBufferAllocator::GetBufferAllocation(size_t size, size_t alignment)
|
||||
{
|
||||
// Align the size
|
||||
|
@ -55,6 +63,14 @@ MetalBufferAllocation MetalBufferAllocator::GetBufferAllocation(size_t size, siz
|
|||
return allocation;
|
||||
}
|
||||
|
||||
MetalMemoryManager::~MetalMemoryManager()
|
||||
{
|
||||
if (m_bufferCache)
|
||||
{
|
||||
m_bufferCache->release();
|
||||
}
|
||||
}
|
||||
|
||||
void* MetalMemoryManager::GetTextureUploadBuffer(size_t size)
|
||||
{
|
||||
if (m_textureUploadBuffer.size() < size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue