[cocos2dx] Closes #2505, fix warning about memory allocated by Cococs2d-X

This commit is contained in:
Mario Zechner 2024-04-30 10:55:51 +02:00
parent f67807f1e7
commit 9c9bcb9428

View File

@ -110,7 +110,15 @@ namespace spine {
}
virtual char *_readFile(const String &path, int *length) {
return _extension->_readFile(path, length);
auto data = _extension->_readFile(path, length);
if (_allocated.count(data) == 0) {
_allocated[data] = Allocation(data, sizeof(char) * (*length), nullptr, 0);
_allocations++;
_usedMemory += sizeof(char) * (*length);
}
return data;
}
size_t getUsedMemory() {