mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +00:00
Shutdown() freeing a few extra vectors so they don't have to freed by destruction #169
This commit is contained in:
parent
c0eab2a164
commit
92a22ab35f
28
imgui.cpp
28
imgui.cpp
@ -1975,8 +1975,6 @@ void ImGui::Shutdown()
|
||||
}
|
||||
g.Windows.clear();
|
||||
g.CurrentWindowStack.clear();
|
||||
g.RenderDrawLists.clear();
|
||||
g.CursorDrawList.Clear();
|
||||
g.FocusedWindow = NULL;
|
||||
g.HoveredWindow = NULL;
|
||||
g.HoveredRootWindow = NULL;
|
||||
@ -1989,26 +1987,29 @@ void ImGui::Shutdown()
|
||||
g.ColorModifiers.clear();
|
||||
g.StyleModifiers.clear();
|
||||
g.FontStack.clear();
|
||||
g.RenderDrawLists.clear();
|
||||
g.RenderSortedWindows.clear();
|
||||
g.CursorDrawList.ClearFreeMemory();
|
||||
g.ColorEditModeStorage.Clear();
|
||||
if (g.LogFile && g.LogFile != stdout)
|
||||
{
|
||||
fclose(g.LogFile);
|
||||
g.LogFile = NULL;
|
||||
}
|
||||
g.IO.Fonts->Clear();
|
||||
|
||||
if (g.PrivateClipboard)
|
||||
{
|
||||
ImGui::MemFree(g.PrivateClipboard);
|
||||
g.PrivateClipboard = NULL;
|
||||
}
|
||||
|
||||
if (g.LogFile && g.LogFile != stdout)
|
||||
{
|
||||
fclose(g.LogFile);
|
||||
g.LogFile = NULL;
|
||||
}
|
||||
if (g.LogClipboard)
|
||||
{
|
||||
g.LogClipboard->~ImGuiTextBuffer();
|
||||
ImGui::MemFree(g.LogClipboard);
|
||||
}
|
||||
|
||||
g.IO.Fonts->Clear();
|
||||
|
||||
g.Initialized = false;
|
||||
}
|
||||
|
||||
@ -7245,6 +7246,15 @@ void ImDrawList::Clear()
|
||||
texture_id_stack.resize(0);
|
||||
}
|
||||
|
||||
void ImDrawList::ClearFreeMemory()
|
||||
{
|
||||
commands.clear();
|
||||
vtx_buffer.clear();
|
||||
vtx_write = NULL;
|
||||
clip_rect_stack.clear();
|
||||
texture_id_stack.clear();
|
||||
}
|
||||
|
||||
void ImDrawList::AddDrawCmd()
|
||||
{
|
||||
ImDrawCmd draw_cmd;
|
||||
|
1
imgui.h
1
imgui.h
@ -865,6 +865,7 @@ struct ImDrawList
|
||||
|
||||
ImDrawList() { Clear(); }
|
||||
IMGUI_API void Clear();
|
||||
IMGUI_API void ClearFreeMemory();
|
||||
IMGUI_API void PushClipRect(const ImVec4& clip_rect); // Scissoring. The values are x1, y1, x2, y2.
|
||||
IMGUI_API void PushClipRectFullScreen();
|
||||
IMGUI_API void PopClipRect();
|
||||
|
Loading…
Reference in New Issue
Block a user