Viewports: DestroyContext() does not call DestroyPlatformWindows() anymore. (#7175, #8945)

This commit is contained in:
ocornut
2025-09-18 16:47:40 +02:00
parent 8ccff82153
commit 16b2d20115
2 changed files with 8 additions and 3 deletions

View File

@@ -4415,6 +4415,11 @@ void ImGui::Shutdown()
ImGuiContext& g = *GImGui;
IM_ASSERT_USER_ERROR(g.IO.BackendPlatformUserData == NULL, "Forgot to shutdown Platform backend?");
IM_ASSERT_USER_ERROR(g.IO.BackendRendererUserData == NULL, "Forgot to shutdown Renderer backend?");
for (ImGuiViewportP* viewport : g.Viewports)
{
IM_UNUSED(viewport);
IM_ASSERT_USER_ERROR(viewport->RendererUserData == NULL && viewport->PlatformUserData == NULL && viewport->PlatformHandle == NULL, "Backend or app forgot to call DestroyPlatformWindows()?");
}
// The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
for (ImFontAtlas* atlas : g.FontAtlases)
@@ -4436,9 +4441,6 @@ void ImGui::Shutdown()
if (g.SettingsLoaded && g.IO.IniFilename != NULL)
SaveIniSettingsToDisk(g.IO.IniFilename);
// Destroy platform windows
DestroyPlatformWindows();
// Shutdown extensions
DockContextShutdown(&g);