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:
parent
43a86a0efe
commit
90da985ea0
2 changed files with 5 additions and 1 deletions
|
@ -117,6 +117,7 @@ MapBlock::~MapBlock()
|
|||
#endif
|
||||
|
||||
delete[] data;
|
||||
if (!m_is_mono_block)
|
||||
porting::TrackFreedMemory(sizeof(MapNode) * nodecount);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue