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
| 9133 | // FIXME: Can't recover from inside BeginTabItem/EndTabItem yet. |
| 9134 | // FIXME: Can't recover from interleaved BeginTabBar/Begin |
| 9135 | void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data) |
| 9136 | { |
| 9137 | // PVS-Studio V1044 is "Loop break conditions do not depend on the number of iterations" |
| 9138 | ImGuiContext& g = *GImGui; |
| 9139 | while (g.CurrentWindowStack.Size > 0) //-V1044 |
| 9140 | { |
| 9141 | ErrorCheckEndWindowRecover(log_callback, user_data); |
| 9142 | ImGuiWindow* window = g.CurrentWindow; |
| 9143 | if (g.CurrentWindowStack.Size == 1) |
| 9144 | { |
| 9145 | IM_ASSERT(window->IsFallbackWindow); |
| 9146 | break; |
| 9147 | } |
| 9148 | if (window->Flags & ImGuiWindowFlags_ChildWindow) |
| 9149 | { |
| 9150 | if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name); |
| 9151 | EndChild(); |
| 9152 | } |
| 9153 | else |
| 9154 | { |
| 9155 | if (log_callback) log_callback(user_data, "Recovered from missing End() for '%s'", window->Name); |
| 9156 | End(); |
| 9157 | } |
| 9158 | } |
| 9159 | } |
| 9160 | |
| 9161 | // Must be called before End()/EndChild() |
| 9162 | void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data) |
nothing calls this directly
no outgoing calls
no test coverage detected