From 0d232051eb6df1d8e337a097f5453b91fd2b40be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 16 Apr 2015 11:38:07 -0700 Subject: [PATCH] Fixed ImGui shutdown when using custom allocator. --- 3rdparty/.editorconfig | 5 +++++ 3rdparty/ocornut-imgui/imgui.cpp | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 3rdparty/.editorconfig diff --git a/3rdparty/.editorconfig b/3rdparty/.editorconfig new file mode 100644 index 00000000..6bca1a7a --- /dev/null +++ b/3rdparty/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[ocornut-imgui/*] +indent_style = space +indent_size = 4 diff --git a/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/ocornut-imgui/imgui.cpp index fbec9b39..13019bde 100644 --- a/3rdparty/ocornut-imgui/imgui.cpp +++ b/3rdparty/ocornut-imgui/imgui.cpp @@ -1070,7 +1070,7 @@ struct ImGuiState int FramerateSecPerFrameIdx; float FramerateSecPerFrameAccum; - ImGuiState() + void Clear() { Initialized = false; Font = NULL; @@ -1117,6 +1117,26 @@ struct ImGuiState memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame)); FramerateSecPerFrameIdx = 0; FramerateSecPerFrameAccum = 0.0f; + + Windows.clear(); + RenderSortedWindows.clear(); + CurrentWindowStack.clear(); + Settings.clear(); + ColorEditModeStorage.Clear(); + ColorModifiers.clear(); + StyleModifiers.clear(); + FontStack.clear(); + RenderDrawLists.clear(); + } + + ImGuiState() + { + Clear(); + } + + ~ImGuiState() + { + Clear(); } }; @@ -1926,6 +1946,7 @@ void ImGui::Shutdown() ImGui::MemFree(g.Windows[i]); } g.Windows.clear(); + g.RenderSortedWindows.clear(); g.CurrentWindowStack.clear(); g.RenderDrawLists.clear(); g.FocusedWindow = NULL; @@ -1960,6 +1981,8 @@ void ImGui::Shutdown() ImGui::MemFree(g.LogClipboard); } + GDefaultFontAtlas.Clear(); + g.Initialized = false; }