Fix memory leak.

This commit is contained in:
Bartosz Taudul 2024-09-08 13:39:40 +02:00
parent 4afc0960fb
commit 6080b8742a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -90,6 +90,15 @@ static void SortFlameGraph( Vector<FlameGraphItem>& data )
for( auto& v : data ) SortFlameGraph( v.children );
}
static void FreeVector( Vector<FlameGraphItem>& data )
{
for( auto& v : data )
{
FreeVector( v.children );
v.children.~Vector();
}
}
struct FlameGraphContext
{
ImDrawList* draw;
@ -217,6 +226,7 @@ void View::DrawFlameGraph()
ImGui::EndChild();
ImGui::End();
FreeVector( data );
}
}