From a550263d6c9dc4f99c951ca28fe582314e757571 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 15 May 2023 11:15:13 +0200 Subject: [PATCH] Misc: made ErrorCheckEndWindowRecover() handle font stack. (#6431, #1651) --- imgui.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index c15db4d13351..6e3e3c5c290b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9198,6 +9198,11 @@ void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, vo if (log_callback) log_callback(user_data, "Recovered from missing PopStyleVar() in '%s'", window->Name); PopStyleVar(); } + while (g.FontStack.Size > stack_sizes->SizeOfFontStack) //-V1044 + { + if (log_callback) log_callback(user_data, "Recovered from missing PopFont() in '%s'", window->Name); + PopFont(); + } while (g.FocusScopeStack.Size > stack_sizes->SizeOfFocusScopeStack + 1) //-V1044 { if (log_callback) log_callback(user_data, "Recovered from missing PopFocusScope() in '%s'", window->Name);