mirror of
https://github.com/ocornut/imgui.git
synced 2026-07-05 17:15:20 +00:00
Fonts, Context: assert that ImFontAtlas has no other references when destroying an owned atlas. (#9426)
This commit is contained in:
10
imgui.cpp
10
imgui.cpp
@@ -4495,10 +4495,14 @@ void ImGui::Shutdown()
|
||||
for (ImFontAtlas* atlas : g.FontAtlases)
|
||||
{
|
||||
UnregisterFontAtlas(atlas);
|
||||
if (atlas->RefCount == 0 && atlas->OwnerContext == &g)
|
||||
if (atlas->OwnerContext == &g)
|
||||
{
|
||||
atlas->Locked = false;
|
||||
IM_DELETE(atlas);
|
||||
IM_ASSERT(atlas->RefCount == 0 && "Destroying context owning a ImFontAtlas which is still used elsewhere!");
|
||||
if (atlas->RefCount == 0)
|
||||
{
|
||||
atlas->Locked = false;
|
||||
IM_DELETE(atlas);
|
||||
}
|
||||
}
|
||||
}
|
||||
g.DrawListSharedData.TempBuffer.clear();
|
||||
|
||||
Reference in New Issue
Block a user