This commit is contained in:
Branimir Karadžić
2017-03-29 21:53:09 -07:00
parent 31312f897d
commit 139c1353ee
2 changed files with 5 additions and 7 deletions

View File

@@ -1456,11 +1456,6 @@ namespace bgfx
, m_declRef.m_vertexDeclMap.getNumElements()
);
for (uint16_t ii = 0, num = m_vertexDeclHandle.getNumHandles(); ii < num; ++ii)
{
VertexDeclHandle handle = { m_vertexDeclHandle.getHandleAt(ii) };
m_declRef.release(handle);
}
m_declRef.shutdown(m_vertexDeclHandle);
#if BGFX_CONFIG_MULTITHREADED

View File

@@ -1961,9 +1961,12 @@ namespace bgfx
template <uint16_t MaxHandlesT>
void shutdown(bx::HandleAllocT<MaxHandlesT>& _handleAlloc)
{
for (VertexDeclMap::Iterator it = m_vertexDeclMap.first(); m_vertexDeclMap.next(it); )
for (uint16_t ii = 0, num = _handleAlloc.getNumHandles(); ii < num; ++ii)
{
_handleAlloc.free(it.handle);
VertexDeclHandle handle = { _handleAlloc.getHandleAt(ii) };
handle = release(handle);
BX_CHECK(isValid(handle), "Failed to release vertex decl handle %d!", handle.idx);
_handleAlloc.free(handle.idx);
}
m_vertexDeclMap.reset();