From 96fec2cbf32012b1fd419903efe815b658d51ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 30 Mar 2017 22:07:23 -0700 Subject: [PATCH] Fixed vertex decl cleanup. --- src/bgfx_p.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index fe3e8596b..988f6a75f 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -1964,8 +1964,8 @@ namespace bgfx for (uint16_t ii = 0, num = _handleAlloc.getNumHandles(); ii < num; ++ii) { VertexDeclHandle handle = { _handleAlloc.getHandleAt(ii) }; - handle = release(handle); - BX_CHECK(isValid(handle), "Failed to release vertex decl handle %d!", handle.idx); + m_vertexDeclRef[handle.idx] = 0; + m_vertexDeclMap.removeByHandle(handle.idx); _handleAlloc.free(handle.idx); } @@ -2004,7 +2004,6 @@ namespace bgfx { if (isValid(_declHandle) ) { - BX_CHECK(0 < m_vertexDeclRef[_declHandle.idx], "Ref counting is messed up for VertexDecl %d!", _declHandle.idx); m_vertexDeclRef[_declHandle.idx]--; if (0 == m_vertexDeclRef[_declHandle.idx])