From d878462866eda650f72b4a77a9c237f31f464769 Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 30 Apr 2017 12:10:30 +0200 Subject: [PATCH] End() avoid calling Columns() if no columns set is open, not sure what it wasn't the case. Pros: Faster. Avoid early crashes StackId underflow that are meant to be more gracefully caught by CheckStacksSize() (with more explicit assert). Cons: Excercise less code. --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index b45e6ace..85a207b2 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4434,7 +4434,8 @@ void ImGui::End() ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; - Columns(1, "#CloseColumns"); + if (window->DC.ColumnsCount != 1) // close columns set if any is open + Columns(1, "#CLOSECOLUMNS"); PopClipRect(); // inner window clip rectangle // Stop logging