diff options
Diffstat (limited to '3rdparty/bgfx/examples/common/imgui/imgui.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/imgui/imgui.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp index 6d2d566dbec..d44a4a46a45 100644 --- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp +++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp @@ -604,12 +604,11 @@ struct Imgui bgfx::destroyUniform(u_imageSwizzle); bgfx::destroyUniform(s_texColor); #if !USE_NANOVG_FONT - for (uint16_t ii = 0; ii < IMGUI_CONFIG_MAX_FONTS; ++ii) + for (uint16_t ii = 0, num = m_fontHandle.getNumHandles(); ii < num; ++ii) { - if (bgfx::isValid(m_fonts[ii].m_texture) ) - { - bgfx::destroyTexture(m_fonts[ii].m_texture); - } + uint16_t idx = m_fontHandle.getHandleAt(0); + bgfx::destroyTexture(m_fonts[idx].m_texture); + m_fontHandle.free(idx); } #endif // !USE_NANOVG_FONT bgfx::destroyTexture(m_missingTexture); |