MCPcopy Create free account
hub / github.com/Raais/ImStudio / ErrorCheckEndFrameRecover

Method ErrorCheckEndFrameRecover

src/third-party/imgui/imgui.cpp:8002–8027  ·  view source on GitHub ↗

Experimental recovery from incorrect usage of BeginXXX/EndXXX/PushXXX/PopXXX calls. Must be called during or before EndFrame(). This is generally flawed as we are not necessarily End/Popping things in the right order. FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. FIXME: Can't recover from interleaved BeginTabBar/Begin

Source from the content-addressed store, hash-verified

8000// FIXME: Can't recover from inside BeginTabItem/EndTabItem yet.
8001// FIXME: Can't recover from interleaved BeginTabBar/Begin
8002void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data)
8003{
8004 // PVS-Studio V1044 is "Loop break conditions do not depend on the number of iterations"
8005 ImGuiContext& g = *GImGui;
8006 while (g.CurrentWindowStack.Size > 0) //-V1044
8007 {
8008 ErrorCheckEndWindowRecover(log_callback, user_data);
8009 ImGuiWindow* window = g.CurrentWindow;
8010 if (g.CurrentWindowStack.Size == 1)
8011 {
8012 IM_ASSERT(window->IsFallbackWindow);
8013 break;
8014 }
8015 IM_ASSERT(window == g.CurrentWindow);
8016 if (window->Flags & ImGuiWindowFlags_ChildWindow)
8017 {
8018 if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name);
8019 EndChild();
8020 }
8021 else
8022 {
8023 if (log_callback) log_callback(user_data, "Recovered from missing End() for '%s'", window->Name);
8024 End();
8025 }
8026 }
8027}
8028
8029// Must be called before End()/EndChild()
8030void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected