Fixed vertexdecl leak.

This commit is contained in:
Branimir Karadžić 2016-03-17 16:46:04 -07:00
parent 61ec034023
commit 5ffff78d8d
2 changed files with 8 additions and 2 deletions

View file

@ -1351,6 +1351,12 @@ namespace bgfx
m_dynVertexBufferAllocator.compact();
m_dynIndexBufferAllocator.compact();
BX_CHECK(m_vertexDeclHandle.getNumHandles() == uint16_t(m_declRef.m_vertexDeclMap.size() )
, "VertexDeclRef mismatch, num handles %d, handles in hash map %d."
, m_vertexDeclHandle.getNumHandles()
, m_declRef.m_vertexDeclMap.size()
);
m_declRef.shutdown(m_vertexDeclHandle);
#if BGFX_CONFIG_MULTITHREADED

View file

@ -2271,7 +2271,7 @@ namespace bgfx
{
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyVertexDecl);
cmdbuf.write(declHandle);
m_submit->free(declHandle);
m_render->free(declHandle);
}
m_vertexBufferHandle.free(_handle.idx);
@ -2564,7 +2564,7 @@ namespace bgfx
{
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyVertexDecl);
cmdbuf.write(declHandle);
m_submit->free(declHandle);
m_render->free(declHandle);
}
if (0 != (dvb.m_flags & BGFX_BUFFER_COMPUTE_WRITE) )