ImGuizmo: Fix crash at exit due to global context.

This commit is contained in:
Branimir Karadžić
2025-10-23 08:53:35 -07:00
parent 4133674f08
commit 1bf37c0da2
3 changed files with 448 additions and 422 deletions

View File

@@ -126,6 +126,12 @@ namespace IMGUIZMO_NAMESPACE
// call BeginFrame right after ImGui_XXXX_NewFrame();
IMGUI_API void BeginFrame();
//
IMGUI_API void Create();
//
IMGUI_API void Destroy();
// this is necessary because when imguizmo is compiled into a dll, and imgui into another
// globals are not shared between them.
// More details at https://stackoverflow.com/questions/19373061/what-happens-to-global-and-static-variables-in-a-shared-library-when-it-is-dynam

File diff suppressed because it is too large Load Diff

View File

@@ -454,11 +454,15 @@ struct OcornutImguiContext
}
}
ImGuizmo::Create();
ImGui::InitDockContext();
}
void destroy()
{
ImGuizmo::Destroy();
for (ImTextureData* texData : ImGui::GetPlatformIO().Textures)
{
if (1 == texData->RefCount)