From 6c1084eaa1bd3f671937ff5132433004ed56d045 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 9 May 2015 10:27:03 +0100 Subject: [PATCH] Shutdown() test for g.IO.Fonts not being NULL to allow workarounds in case of using multiple contexts #207 --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index ffa9d146..00bb582a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2124,7 +2124,8 @@ void ImGui::Shutdown() ImGui::MemFree(g.LogClipboard); } - g.IO.Fonts->Clear(); + if (g.IO.Fonts) // Testing for NULL to allow user to NULLify in case of running Shutdown() on multiple contexts. Bit hacky. + g.IO.Fonts->Clear(); g.Initialized = false; }