Branimir Karadžić %!s(int64=8) %!d(string=hai) anos
pai
achega
139c1353ee
Modificáronse 2 ficheiros con 5 adicións e 7 borrados
  1. 0 5
      src/bgfx.cpp
  2. 5 2
      src/bgfx_p.h

+ 0 - 5
src/bgfx.cpp

@@ -1456,11 +1456,6 @@ namespace bgfx
 				, m_declRef.m_vertexDeclMap.getNumElements()
 				, 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);
 		m_declRef.shutdown(m_vertexDeclHandle);
 
 
 #if BGFX_CONFIG_MULTITHREADED
 #if BGFX_CONFIG_MULTITHREADED

+ 5 - 2
src/bgfx_p.h

@@ -1961,9 +1961,12 @@ namespace bgfx
 		template <uint16_t MaxHandlesT>
 		template <uint16_t MaxHandlesT>
 		void shutdown(bx::HandleAllocT<MaxHandlesT>& _handleAlloc)
 		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();
 			m_vertexDeclMap.reset();