mirror of
https://github.com/ocornut/imgui.git
synced 2026-09-29 04:35:49 +03:00
Fonts: fixed an issue where passing a manually created ImFontAtlas to CreateContext() would incorrectly destroy it in DestroyContext() when ref-count gets back to zero. (#9426)
# Conflicts: # docs/CHANGELOG.txt
This commit is contained in:
parent
5a42cddcd2
commit
c4eaac6d48
2 changed files with 3 additions and 1 deletions
|
|
@ -4476,7 +4476,7 @@ void ImGui::Shutdown()
|
|||
for (ImFontAtlas* atlas : g.FontAtlases)
|
||||
{
|
||||
UnregisterFontAtlas(atlas);
|
||||
if (atlas->RefCount == 0)
|
||||
if (atlas->RefCount == 0 && atlas->OwnerContext == &g)
|
||||
{
|
||||
atlas->Locked = false;
|
||||
IM_DELETE(atlas);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue