mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
ImGui: Fixed texture leak.
This commit is contained in:
@@ -459,6 +459,17 @@ struct OcornutImguiContext
|
||||
|
||||
void destroy()
|
||||
{
|
||||
for (ImTextureData* texData : ImGui::GetPlatformIO().Textures)
|
||||
{
|
||||
if (1 == texData->RefCount)
|
||||
{
|
||||
ImGui::TextureBgfx tex = bx::bitCast<ImGui::TextureBgfx>(texData->GetTexID() );
|
||||
bgfx::destroy(tex.handle);
|
||||
texData->SetTexID(ImTextureID_Invalid);
|
||||
texData->SetStatus(ImTextureStatus_Destroyed);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::ShutdownDockContext();
|
||||
ImGui::DestroyContext(m_imgui);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user