Cleanup zone data.

This commit is contained in:
Bartosz Taudul 2018-04-21 20:34:29 +02:00
parent 0de5bcacaf
commit 4cd9cf5dd9

View File

@ -550,6 +550,16 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
}
}
template<class T>
static inline void ZoneCleanup( Vector<T>& vec )
{
for( auto& v : vec )
{
ZoneCleanup( v->child );
}
vec.~Vector<T>();
}
Worker::~Worker()
{
Shutdown();
@ -560,6 +570,14 @@ Worker::~Worker()
delete[] m_buffer;
LZ4_freeStreamDecode( m_stream );
for( auto& v : m_data.threads )
{
ZoneCleanup( v->timeline );
}
for( auto& v : m_data.gpuData )
{
ZoneCleanup( v->timeline );
}
for( auto& v : m_data.plots )
{
v->~PlotData();