mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-24 16:48:18 -05:00
Fixed ImGui shutdown when using custom allocator.
This commit is contained in:
parent
66017329cc
commit
0d232051eb
2 changed files with 29 additions and 1 deletions
5
3rdparty/.editorconfig
vendored
Normal file
5
3rdparty/.editorconfig
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
root = true
|
||||
|
||||
[ocornut-imgui/*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
25
3rdparty/ocornut-imgui/imgui.cpp
vendored
25
3rdparty/ocornut-imgui/imgui.cpp
vendored
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue