Vector: Call destructors on deallocation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
I hate the Gitea web editor on a phone.
This commit is contained in:
parent
e99ba4df36
commit
e241c70aad
@ -65,7 +65,13 @@ template <typename T> class Vector
|
||||
|
||||
~Vector()
|
||||
{
|
||||
if (m_data) free_impl(m_data);
|
||||
if (m_data) {
|
||||
for(const T& item : *this)
|
||||
{
|
||||
item.~T();
|
||||
}
|
||||
free_impl(m_data);
|
||||
}
|
||||
}
|
||||
|
||||
Result<void> try_reserve(usize capacity)
|
||||
|
Loading…
Reference in New Issue
Block a user