浏览代码

Textures: fixed an issue preventing multi-contexts sharing a ImFontAtlas from being possible to destroy in any order.

ocornut 1 周之前
父节点
当前提交
b987970870
共有 3 个文件被更改,包括 4 次插入2 次删除
  1. 2 0
      docs/CHANGELOG.txt
  2. 1 1
      imgui.cpp
  3. 1 1
      imgui.h

+ 2 - 0
docs/CHANGELOG.txt

@@ -69,6 +69,8 @@ Other Changes:
 - Misc: Debuggers: added type formatters for the LLDB debuggers (e.g. Xcode,
 - Misc: Debuggers: added type formatters for the LLDB debuggers (e.g. Xcode,
   Android Studio & more) to provide nicer display for ImVec2, ImVec4, ImVector etc.
   Android Studio & more) to provide nicer display for ImVec2, ImVec4, ImVector etc.
   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
+  being possible to destroy in any order.
 - 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

+ 1 - 1
imgui.cpp

@@ -4326,7 +4326,7 @@ void ImGui::Shutdown()
     for (ImFontAtlas* atlas : g.FontAtlases)
     for (ImFontAtlas* atlas : g.FontAtlases)
     {
     {
         UnregisterFontAtlas(atlas);
         UnregisterFontAtlas(atlas);
-        if (atlas->OwnerContext == &g)
+        if (atlas->RefCount == 0)
         {
         {
             atlas->Locked = false;
             atlas->Locked = false;
             IM_DELETE(atlas);
             IM_DELETE(atlas);

+ 1 - 1
imgui.h

@@ -29,7 +29,7 @@
 // Library Version
 // Library Version
 // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
 // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
 #define IMGUI_VERSION       "1.92.4 WIP"
 #define IMGUI_VERSION       "1.92.4 WIP"
-#define IMGUI_VERSION_NUM   19233
+#define IMGUI_VERSION_NUM   19234
 #define IMGUI_HAS_TABLE             // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
 #define IMGUI_HAS_TABLE             // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
 #define IMGUI_HAS_TEXTURES          // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
 #define IMGUI_HAS_TEXTURES          // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198