diff --git a/LEGO1/tgl/d3drm/mesh.cpp b/LEGO1/tgl/d3drm/mesh.cpp index 29858f9f..383e421c 100644 --- a/LEGO1/tgl/d3drm/mesh.cpp +++ b/LEGO1/tgl/d3drm/mesh.cpp @@ -11,7 +11,7 @@ DECOMP_SIZE_ASSERT(MeshImpl, 0x8); MeshImpl::~MeshImpl() { if (m_data) { - free(m_data); + delete m_data; m_data = NULL; } } diff --git a/LEGO1/tgl/d3drm/texture.cpp b/LEGO1/tgl/d3drm/texture.cpp index 18b121eb..d8c69738 100644 --- a/LEGO1/tgl/d3drm/texture.cpp +++ b/LEGO1/tgl/d3drm/texture.cpp @@ -81,9 +81,9 @@ TglD3DRMIMAGE::TglD3DRMIMAGE( void TglD3DRMIMAGE::Destroy() { if (m_texelsAllocatedByClient == 0) { - free(m_image.buffer1); + delete m_image.buffer1; } - free(m_image.palette); + delete m_image.palette; } // OFFSET: LEGO1 0x100a13e0 STUB @@ -106,12 +106,12 @@ Result TglD3DRMIMAGE::InitializePalette(int paletteSize, PaletteEntry* pEntries) // into into the TglD3DRMIMAGE class instead of being a global struct. if (m_image.palette_size != paletteSize) { if (m_image.palette != NULL) { - free(m_image.palette); + delete m_image.palette; m_image.palette = NULL; m_image.palette_size = 0; } if (paletteSize > 0) { - m_image.palette = (D3DRMPALETTEENTRY*) malloc(4 * paletteSize); + m_image.palette = new D3DRMPALETTEENTRY[paletteSize]; m_image.palette_size = paletteSize; } }