feat(array): add TSFixedArray<T>::~TSFixedArray

This commit is contained in:
fallenoak 2021-01-03 10:36:37 -06:00
parent ac1f63906c
commit 577fb30be0
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D

View file

@ -8,10 +8,23 @@
template <class T>
class TSFixedArray : public TSBaseArray<T> {
public:
~TSFixedArray();
void ReallocData(uint32_t count);
void SetCount(uint32_t count);
};
template <class T>
TSFixedArray<T>::~TSFixedArray() {
for (int32_t i = 0; i < this->Count(); i++) {
auto element = &this->operator[](i);
element->~T();
}
if (this->Ptr()) {
SMemFree(this->Ptr(), this->MemFileName(), this->MemLineNo(), 0x0);
}
}
template <class T>
void TSFixedArray<T>::ReallocData(uint32_t count) {
T* oldData = this->m_data;