From 3a79ff39fc16380b92ca276c3014344655baf7fe Mon Sep 17 00:00:00 2001 From: Evan Pezent Date: Fri, 12 Jun 2020 07:59:17 -0500 Subject: [PATCH] fix memory leak in BenchmarkItem --- implot_demo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/implot_demo.cpp b/implot_demo.cpp index d145d5b..cef1e0d 100644 --- a/implot_demo.cpp +++ b/implot_demo.cpp @@ -114,7 +114,7 @@ struct BenchmarkItem { } Col = ImVec4((float)RandomRange(0,1),(float)RandomRange(0,1),(float)RandomRange(0,1),1); } - ~BenchmarkItem() { delete Data; } + ~BenchmarkItem() { delete[] Data; } t_float2* Data; ImVec4 Col; }; @@ -972,6 +972,7 @@ void ShowDemoWindow(bool* p_open) { static BenchmarkItem items[n_items]; ImGui::BulletText("Make sure VSync is disabled."); ImGui::BulletText("%d lines with %d points each @ %.3f FPS.",n_items,1000,ImGui::GetIO().Framerate); + ImPlot::SetNextPlotLimits(0,1,0,1,ImGuiCond_Always); if (ImPlot::BeginPlot("##Bench",NULL,NULL,ImVec2(-1,0),ImPlotFlags_Default | ImPlotFlags_NoChild)) { char buff[16]; for (int i = 0; i < 100; ++i) {