mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-16 00:54:19 +00:00
ImVector: added clear_delete(), clear_destruct() helpers.
# Conflicts: # imgui.cpp
This commit is contained in:
parent
865b2ca6f9
commit
4161a67b38
4 changed files with 14 additions and 22 deletions
15
imgui.cpp
15
imgui.cpp
|
|
@ -2971,8 +2971,7 @@ ImGuiWindow::~ImGuiWindow()
|
|||
{
|
||||
IM_ASSERT(DrawList == &DrawListInst);
|
||||
IM_DELETE(Name);
|
||||
for (int i = 0; i != ColumnsStorage.Size; i++)
|
||||
ColumnsStorage[i].~ImGuiOldColumns();
|
||||
ColumnsStorage.clear_destruct();
|
||||
}
|
||||
|
||||
ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
|
||||
|
|
@ -4343,9 +4342,7 @@ void ImGui::Shutdown(ImGuiContext* context)
|
|||
CallContextHooks(&g, ImGuiContextHookType_Shutdown);
|
||||
|
||||
// Clear everything else
|
||||
for (int i = 0; i < g.Windows.Size; i++)
|
||||
IM_DELETE(g.Windows[i]);
|
||||
g.Windows.clear();
|
||||
g.Windows.clear_delete();
|
||||
g.WindowsFocusOrder.clear();
|
||||
g.WindowsTempSortBuffer.clear();
|
||||
g.CurrentWindow = NULL;
|
||||
|
|
@ -4362,18 +4359,14 @@ void ImGui::Shutdown(ImGuiContext* context)
|
|||
g.BeginPopupStack.clear();
|
||||
|
||||
g.CurrentViewport = g.MouseViewport = g.MouseLastHoveredViewport = NULL;
|
||||
for (int i = 0; i < g.Viewports.Size; i++)
|
||||
IM_DELETE(g.Viewports[i]);
|
||||
g.Viewports.clear();
|
||||
g.Viewports.clear_delete();
|
||||
|
||||
g.TabBars.Clear();
|
||||
g.CurrentTabBarStack.clear();
|
||||
g.ShrinkWidthBuffer.clear();
|
||||
|
||||
g.Tables.Clear();
|
||||
for (int i = 0; i < g.TablesTempDataStack.Size; i++)
|
||||
g.TablesTempDataStack[i].~ImGuiTableTempData();
|
||||
g.TablesTempDataStack.clear();
|
||||
g.TablesTempDataStack.clear_destruct();
|
||||
g.DrawChannelsTempMergeBuffer.clear();
|
||||
|
||||
g.ClipboardHandlerData.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue