mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Textures: Fixed not updating ImTextureData's RefCount when destroying a context using a shared ImFontAtlas. (#8975)
This commit is contained in:
parent
b987970870
commit
9809b0b061
3 changed files with 8 additions and 1 deletions
|
|
@ -8841,6 +8841,8 @@ void ImGui::RegisterFontAtlas(ImFontAtlas* atlas)
|
|||
atlas->RefCount++;
|
||||
g.FontAtlases.push_back(atlas);
|
||||
ImFontAtlasAddDrawListSharedData(atlas, &g.DrawListSharedData);
|
||||
for (ImTextureData* tex : atlas->TexList)
|
||||
tex->RefCount = (unsigned short)atlas->RefCount;
|
||||
}
|
||||
|
||||
void ImGui::UnregisterFontAtlas(ImFontAtlas* atlas)
|
||||
|
|
@ -8850,6 +8852,8 @@ void ImGui::UnregisterFontAtlas(ImFontAtlas* atlas)
|
|||
ImFontAtlasRemoveDrawListSharedData(atlas, &g.DrawListSharedData);
|
||||
g.FontAtlases.find_erase(atlas);
|
||||
atlas->RefCount--;
|
||||
for (ImTextureData* tex : atlas->TexList)
|
||||
tex->RefCount = (unsigned short)atlas->RefCount;
|
||||
}
|
||||
|
||||
// Use ImDrawList::_SetTexture(), making our shared g.FontStack[] authoritative against window-local ImDrawList.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue