1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-30 18:34:34 +01:00

Fixed calling DestroyContext() always saving .ini data with the current context instead of the supplied context pointer. (#2066)

This commit is contained in:
omar 2018-09-07 17:23:55 +02:00
parent eb7033e75b
commit 2eaf722fd7
2 changed files with 10 additions and 0 deletions

View File

@ -33,6 +33,11 @@ HOW TO UPDATE?
VERSION 1.66 (In Progress)
-----------------------------------------------------------------------
Other Changes:
- Fixed calling DestroyContext() always saving .ini data with the current context instead
of the supplied context pointer. (#2066)
-----------------------------------------------------------------------
VERSION 1.65 (Released 2018-09-06)

View File

@ -3281,7 +3281,12 @@ void ImGui::Shutdown(ImGuiContext* context)
// Save settings (unless we haven't attempted to load them: CreateContext/DestroyContext without a call to NewFrame shouldn't save an empty file)
if (g.SettingsLoaded && g.IO.IniFilename != NULL)
{
ImGuiContext* backup_context = GImGui;
SetCurrentContext(context);
SaveIniSettingsToDisk(g.IO.IniFilename);
SetCurrentContext(backup_context);
}
// Clear everything else
for (int i = 0; i < g.Windows.Size; i++)