Fix memory leak of Vector::setSize (#2781)

* Fix memory leak of Vector::setSize

* Format code
This commit is contained in:
James Chen 2025-04-08 17:48:47 +08:00 committed by GitHub
parent 4071565a9c
commit f037c05b73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,6 +85,10 @@ namespace spine {
for (size_t i = oldSize; i < _size; i++) {
construct(_buffer + i, defaultValue);
}
} else {
for (size_t i = _size; i < oldSize; i++) {
destroy(_buffer + i);
}
}
}