Fix bad delete in font_manager.cpp (#2703)

Fix alloc-dealloc-mismatch (operator new [] vs operator delete
This commit is contained in:
Paul Gruenbacher
2022-01-03 14:52:53 -06:00
committed by GitHub
parent af68e138fe
commit 5b4a6dc330

View File

@@ -284,7 +284,7 @@ TrueTypeHandle FontManager::createTtf(const uint8_t* _buffer, uint32_t _size)
void FontManager::destroyTtf(TrueTypeHandle _handle)
{
BX_ASSERT(isValid(_handle), "Invalid handle used");
delete m_cachedFiles[_handle.idx].buffer;
delete[] m_cachedFiles[_handle.idx].buffer;
m_cachedFiles[_handle.idx].bufferSize = 0;
m_cachedFiles[_handle.idx].buffer = NULL;
m_filesHandles.free(_handle.idx);