mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Misc: During shutdown, check that io.BackendPlatformUserData and io.BackendRendererUserData are NULL. (#7175)
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user