diff options
| author | Dentomologist <dentomologist@gmail.com> | 2025-02-02 13:02:58 -0800 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2025-02-02 14:14:56 -0800 |
| commit | f94e6cb73e1438eafb8219548d561fa69534f7ae (patch) | |
| tree | 958a65c3638dbe84b603a1435228629aeaf2bf3c | |
| parent | 84d28a4272f53df30550b43aaafafde1a520aeb0 (diff) | |
PerformanceMetrics: Call ImGui::End() unconditionally
Move ImGui::End() calls out of if(ImGui::Begin()) blocks.
Quoting from ImGui::Begin's function comment in imgui.cpp:
"You always need to call ImGui::End() even if false is returned."
In practice this didn't cause problems because the windows don't have
title bars and thus can't be collapsed, and so the block containing
::End would always run, but let's do it the right way.
| -rw-r--r-- | Source/Core/VideoCommon/PerformanceMetrics.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/PerformanceMetrics.cpp b/Source/Core/VideoCommon/PerformanceMetrics.cpp index a3d41c9872..910b3c615e 100644 --- a/Source/Core/VideoCommon/PerformanceMetrics.cpp +++ b/Source/Core/VideoCommon/PerformanceMetrics.cpp @@ -183,8 +183,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) ImPlot::PopStyleColor(2); } ImGui::PopStyleVar(); - ImGui::End(); } + ImGui::End(); } if (g_ActiveConfig.bShowSpeed) @@ -205,8 +205,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) { ImGui::TextColored(ImVec4(r, g, b, 1.0f), "Speed:%4.0lf%%", 100.0 * speed); ImGui::TextColored(ImVec4(r, g, b, 1.0f), "Max:%6.0lf%%", 100.0 * GetMaxSpeed()); - ImGui::End(); } + ImGui::End(); } if (g_ActiveConfig.bShowFPS || g_ActiveConfig.bShowFTimes) @@ -235,8 +235,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) ImGui::TextColored(ImVec4(r, g, b, 1.0f), " ±:%6.2lfms", DT_ms(m_fps_counter.GetDtStd()).count()); } - ImGui::End(); } + ImGui::End(); } if (g_ActiveConfig.bShowVPS || g_ActiveConfig.bShowVTimes) @@ -265,8 +265,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale) ImGui::TextColored(ImVec4(r, g, b, 1.0f), " ±:%6.2lfms", DT_ms(m_vps_counter.GetDtStd()).count()); } - ImGui::End(); } + ImGui::End(); } ImGui::PopStyleVar(2); |
