mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[cocos2dx] Closes #2505, fix warning about memory allocated by Cococs2d-X
This commit is contained in:
parent
f67807f1e7
commit
9c9bcb9428
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user