1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-09 23:54:20 +00:00

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)); memset(TempKeychordName, 0, sizeof(TempKeychordName));
} }
ImGuiContext::~ImGuiContext()
{
IM_ASSERT(Initialized == false && "Forgot to call DestroyContext()?");
}
void ImGui::Initialize() void ImGui::Initialize()
{ {
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;

View file

@ -2546,6 +2546,7 @@ struct ImGuiContext
char TempKeychordName[64]; char TempKeychordName[64];
ImGuiContext(ImFontAtlas* shared_font_atlas); ImGuiContext(ImFontAtlas* shared_font_atlas);
~ImGuiContext();
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------