diff --git a/storm/array/TSFixedArray.hpp b/storm/array/TSFixedArray.hpp index 0782322..46a73c5 100644 --- a/storm/array/TSFixedArray.hpp +++ b/storm/array/TSFixedArray.hpp @@ -8,10 +8,23 @@ template class TSFixedArray : public TSBaseArray { public: + ~TSFixedArray(); void ReallocData(uint32_t count); void SetCount(uint32_t count); }; +template +TSFixedArray::~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 void TSFixedArray::ReallocData(uint32_t count) { T* oldData = this->m_data;