mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-03 03:50:06 +00:00
ImVector: added clear_delete(), clear_destruct() helpers.
This commit is contained in:
parent
61f4aec868
commit
d0c6dd9baf
4 changed files with 14 additions and 22 deletions
15
imgui.cpp
15
imgui.cpp
|
|
@ -2927,8 +2927,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)
|
||||
|
|
@ -4189,9 +4188,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;
|
||||
|
|
@ -4207,18 +4204,14 @@ void ImGui::Shutdown(ImGuiContext* context)
|
|||
g.OpenPopupStack.clear();
|
||||
g.BeginPopupStack.clear();
|
||||
|
||||
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