Explorar o código

Check handle freeing.

Branimir Karadžić %!s(int64=11) %!d(string=hai) anos
pai
achega
17a8602205
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      include/bx/handlealloc.h

+ 1 - 0
include/bx/handlealloc.h

@@ -68,6 +68,7 @@ namespace bx
 
 		void free(uint16_t _handle)
 		{
+			BX_CHECK(0 < m_numHandles, "Freeing invalid handle %d.", _handle);
 			uint16_t* sparse = &m_handles[MaxHandlesT];
 			uint16_t index = sparse[_handle];
 			--m_numHandles;