Misc: During shutdown, check that io.BackendPlatformUserData and io.BackendRendererUserData are NULL. (#7175)
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 6af62ec..291030a 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -72,6 +72,7 @@
to allow passing through multiple widgets easily. (#3092, #5759, #787)
- Drags, Sliders, Inputs: removed all attempts to filter non-numerical characters during text
editing. Invalid inputs not applied to value, visibly reverted after validation. (#6810, #7096)
+- Drags, Sliders, Inputs: removal of filter means that "nan" and "inf" values may be input. (#7096)
- DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: improve multi-components
width computation to better distribute the error. (#7120, #7121) [@Nahor]
- ColorEdit4: Layout tweaks for very small sizes. (#7120, #7121)
@@ -90,6 +91,8 @@
like most printf implementations. (#7016, #3466, #6846) [@codefrog2002]
- Misc: Renamed some defines in imstb_textedit.h to avoid conflicts when using unity/jumbo builds
on a codebase where another copy of the library is used.
+- Misc: During shutdown, check that io.BackendPlatformUserData and io.BackendRendererUserData are NULL
+ in order to catch cases where backend was not shut down. (#7175)
- Backends: GLFW, Emscripten: Added ImGui_ImplGlfw_InstallEmscriptenCanvasResizeCallback() to
register canvas selector and auto-resize GLFW window. (#6751) [@Traveller23, @ypujante]
- Backends: GLFW: Fixed Windows specific hooks to use Unicode version of WndProc even when
diff --git a/imgui.cpp b/imgui.cpp
index 77661fa..f5dc8f0 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -3604,8 +3604,11 @@
// 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;