Textures: fixed an issue preventing multi-contexts sharing a ImFontAtlas from being possible to destroy in any order.

This commit is contained in:
ocornut
2025-10-01 14:58:30 +02:00
parent a3d6e82dbd
commit b987970870
3 changed files with 4 additions and 2 deletions

View File

@@ -4326,7 +4326,7 @@ void ImGui::Shutdown()
for (ImFontAtlas* atlas : g.FontAtlases)
{
UnregisterFontAtlas(atlas);
if (atlas->OwnerContext == &g)
if (atlas->RefCount == 0)
{
atlas->Locked = false;
IM_DELETE(atlas);