Misc: added assert to detect ~ImGuiContext() called without DestroyContext(). (#9051)

This commit is contained in:
ocornut
2025-11-04 17:55:18 +01:00
parent 051a31594f
commit 1897248bda
2 changed files with 6 additions and 0 deletions

View File

@@ -4277,6 +4277,11 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
memset(TempKeychordName, 0, sizeof(TempKeychordName));
}
ImGuiContext::~ImGuiContext()
{
IM_ASSERT(Initialized == false && "Forgot to call DestroyContext()?");
}
void ImGui::Initialize()
{
ImGuiContext& g = *GImGui;