1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

track memory correctly

This commit is contained in:
Lars 2025-05-20 14:00:18 -07:00
parent 43a86a0efe
commit 90da985ea0
2 changed files with 5 additions and 1 deletions

View file

@ -117,6 +117,7 @@ MapBlock::~MapBlock()
#endif
delete[] data;
if (!m_is_mono_block)
porting::TrackFreedMemory(sizeof(MapNode) * nodecount);
}

View file

@ -440,6 +440,9 @@ private:
void reallocate(u32 c, MapNode n)
{
delete[] data;
if (c == 1)
porting::TrackFreedMemory(sizeof(MapNode) * nodecount);
data = new MapNode[c];
for (u32 i = 0; i < c; i++)
data[i] = n;