mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-03 03:50:06 +00:00
Misc: During shutdown, check that io.BackendPlatformUserData and io.BackendRendererUserData are NULL. (#7175)
This commit is contained in:
parent
0ea99132c8
commit
33d18c580b
2 changed files with 7 additions and 1 deletions
|
|
@ -3604,8 +3604,11 @@ void ImGui::Initialize()
|
|||
// This function is merely here to free heap allocations.
|
||||
void ImGui::Shutdown()
|
||||
{
|
||||
// The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT_USER_ERROR(g.IO.BackendPlatformUserData == NULL, "Forgot to shutdown Platform backend?");
|
||||
IM_ASSERT_USER_ERROR(g.IO.BackendRendererUserData == NULL, "Forgot to shutdown Renderer backend?");
|
||||
|
||||
// The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
|
||||
if (g.IO.Fonts && g.FontAtlasOwnedByContext)
|
||||
{
|
||||
g.IO.Fonts->Locked = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue