From f31f98f4cda8552531d9a65ef170b527c32bd51f Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 23 Jul 2026 17:55:43 +0200 Subject: [PATCH] ImDrawData: fixed late initialized field. (Amend 6f41d13) Would effectively be initialized on use but best to clear on constructor. --- imgui.h | 2 +- imgui_draw.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.h b/imgui.h index 5ef2e61a5..918d253d2 100644 --- a/imgui.h +++ b/imgui.h @@ -3495,7 +3495,7 @@ struct ImDrawList struct ImDrawData { bool Valid; // Only valid after Render() is called and before the next NewFrame() is called. - int FrameCount; // Frame counter of the emitter context. For debugging purpose. + int FrameCount; // Frame counter of the emitter context. Mostly for debugging purpose. int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size ImVector CmdLists; // Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here. diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 8598d7026..6ec7478b9 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -2280,7 +2280,7 @@ void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx) void ImDrawData::Clear() { Valid = false; - TotalIdxCount = TotalVtxCount = 0; + FrameCount = TotalIdxCount = TotalVtxCount = 0; CmdLists.resize(0); // The ImDrawList are NOT owned by ImDrawData but e.g. by ImGuiContext, so we don't clear them. DisplayPos = DisplaySize = FramebufferScale = ImVec2(0.0f, 0.0f); OwnerViewport = NULL;