mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-23 02:04:22 +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
|
|
@ -2012,9 +2012,7 @@ void ImFontAtlas::ClearTexData()
|
|||
void ImFontAtlas::ClearFonts()
|
||||
{
|
||||
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
|
||||
for (int i = 0; i < Fonts.Size; i++)
|
||||
IM_DELETE(Fonts[i]);
|
||||
Fonts.clear();
|
||||
Fonts.clear_delete();
|
||||
}
|
||||
|
||||
void ImFontAtlas::Clear()
|
||||
|
|
@ -2574,9 +2572,8 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
|
|||
}
|
||||
}
|
||||
|
||||
// Cleanup temporary (ImVector doesn't honor destructor)
|
||||
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
|
||||
src_tmp_array[src_i].~ImFontBuildSrcData();
|
||||
// Cleanup
|
||||
src_tmp_array.clear_destruct();
|
||||
|
||||
ImFontAtlasBuildFinish(atlas);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue