|
|
|
@ -7316,11 +7316,37 @@ void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, voi
|
|
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
|
while (g.CurrentWindowStack.Size > 0)
|
|
|
|
|
{
|
|
|
|
|
ErrorCheckEndWindowRecover(log_callback, user_data);
|
|
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
|
if (g.CurrentWindowStack.Size == 1)
|
|
|
|
|
{
|
|
|
|
|
IM_ASSERT(window->IsFallbackWindow);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
IM_ASSERT(window == g.CurrentWindow);
|
|
|
|
|
if (window->Flags & ImGuiWindowFlags_ChildWindow)
|
|
|
|
|
{
|
|
|
|
|
if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name);
|
|
|
|
|
EndChild();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (log_callback) log_callback(user_data, "Recovered from missing End() for '%s'", window->Name);
|
|
|
|
|
End();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Must be called before End()/EndChild()
|
|
|
|
|
void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data)
|
|
|
|
|
{
|
|
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
|
while (g.CurrentTable && (g.CurrentTable->OuterWindow == g.CurrentWindow || g.CurrentTable->InnerWindow == g.CurrentWindow))
|
|
|
|
|
{
|
|
|
|
|
if (log_callback) log_callback(user_data, "Recovered from missing EndTable() in '%s'", g.CurrentTable->OuterWindow->Name);
|
|
|
|
|
EndTable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
|
IM_ASSERT(window != NULL);
|
|
|
|
|
while (g.CurrentTabBar != NULL) //-V1044
|
|
|
|
@ -7368,23 +7394,6 @@ void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, voi
|
|
|
|
|
if (log_callback) log_callback(user_data, "Recovered from missing PopFocusScope() in '%s'", window->Name);
|
|
|
|
|
PopFocusScope();
|
|
|
|
|
}
|
|
|
|
|
if (g.CurrentWindowStack.Size == 1)
|
|
|
|
|
{
|
|
|
|
|
IM_ASSERT(g.CurrentWindow->IsFallbackWindow);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
IM_ASSERT(window == g.CurrentWindow);
|
|
|
|
|
if (window->Flags & ImGuiWindowFlags_ChildWindow)
|
|
|
|
|
{
|
|
|
|
|
if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name);
|
|
|
|
|
EndChild();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (log_callback) log_callback(user_data, "Recovered from missing End() for '%s'", window->Name);
|
|
|
|
|
End();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Save current stack sizes for later compare
|
|
|
|
|