mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-03 16:46:29 +00:00
Textures: Fixed not updating ImTextureData's RefCount when destroying a context using a shared ImFontAtlas. (#8975)
This commit is contained in:
@@ -596,7 +596,7 @@ void ImGui_ImplDX11_InvalidateDeviceObjects()
|
|||||||
if (tex->RefCount == 1)
|
if (tex->RefCount == 1)
|
||||||
ImGui_ImplDX11_DestroyTexture(tex);
|
ImGui_ImplDX11_DestroyTexture(tex);
|
||||||
|
|
||||||
if (bd->pTexSamplerLinear) { bd->pTexSamplerLinear->Release(); bd->pTexSamplerLinear = nullptr; }
|
if (bd->pTexSamplerLinear) { bd->pTexSamplerLinear->Release(); bd->pTexSamplerLinear = nullptr; }
|
||||||
if (bd->pIB) { bd->pIB->Release(); bd->pIB = nullptr; }
|
if (bd->pIB) { bd->pIB->Release(); bd->pIB = nullptr; }
|
||||||
if (bd->pVB) { bd->pVB->Release(); bd->pVB = nullptr; }
|
if (bd->pVB) { bd->pVB->Release(); bd->pVB = nullptr; }
|
||||||
if (bd->pBlendState) { bd->pBlendState->Release(); bd->pBlendState = nullptr; }
|
if (bd->pBlendState) { bd->pBlendState->Release(); bd->pBlendState = nullptr; }
|
||||||
|
@@ -71,6 +71,9 @@ Other Changes:
|
|||||||
See misc/debuggers/ for details. (#8950) [@mentlerd]
|
See misc/debuggers/ for details. (#8950) [@mentlerd]
|
||||||
- Textures: fixed an issue preventing multi-contexts sharing a ImFontAtlas from
|
- Textures: fixed an issue preventing multi-contexts sharing a ImFontAtlas from
|
||||||
being possible to destroy in any order.
|
being possible to destroy in any order.
|
||||||
|
- Textures: fixed not updating ImTextureData's RefCount when destroying a context
|
||||||
|
using a shared ImFontAtlas, leading standard backends to not properly free
|
||||||
|
texture resources. (#8975) [@icrashstuff]
|
||||||
- CI: Updates Windows CI scripts to generate/use VulkanSDK. (#8925, #8778) [@yaz0r]
|
- CI: Updates Windows CI scripts to generate/use VulkanSDK. (#8925, #8778) [@yaz0r]
|
||||||
- Backends: all backends call ImGuiPlatformIO::ClearPlatformHandlers() and
|
- Backends: all backends call ImGuiPlatformIO::ClearPlatformHandlers() and
|
||||||
ClearRendererHandlers() on shutdown, so as not to leave function pointers
|
ClearRendererHandlers() on shutdown, so as not to leave function pointers
|
||||||
|
@@ -8841,6 +8841,8 @@ void ImGui::RegisterFontAtlas(ImFontAtlas* atlas)
|
|||||||
atlas->RefCount++;
|
atlas->RefCount++;
|
||||||
g.FontAtlases.push_back(atlas);
|
g.FontAtlases.push_back(atlas);
|
||||||
ImFontAtlasAddDrawListSharedData(atlas, &g.DrawListSharedData);
|
ImFontAtlasAddDrawListSharedData(atlas, &g.DrawListSharedData);
|
||||||
|
for (ImTextureData* tex : atlas->TexList)
|
||||||
|
tex->RefCount = (unsigned short)atlas->RefCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui::UnregisterFontAtlas(ImFontAtlas* atlas)
|
void ImGui::UnregisterFontAtlas(ImFontAtlas* atlas)
|
||||||
@@ -8850,6 +8852,8 @@ void ImGui::UnregisterFontAtlas(ImFontAtlas* atlas)
|
|||||||
ImFontAtlasRemoveDrawListSharedData(atlas, &g.DrawListSharedData);
|
ImFontAtlasRemoveDrawListSharedData(atlas, &g.DrawListSharedData);
|
||||||
g.FontAtlases.find_erase(atlas);
|
g.FontAtlases.find_erase(atlas);
|
||||||
atlas->RefCount--;
|
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.
|
// Use ImDrawList::_SetTexture(), making our shared g.FontStack[] authoritative against window-local ImDrawList.
|
||||||
|
Reference in New Issue
Block a user