2
0
Эх сурвалжийг харах

Shutdown() test for g.IO.Fonts not being NULL to allow workarounds in case of using multiple contexts #207

ocornut 10 жил өмнө
parent
commit
6c1084eaa1
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      imgui.cpp

+ 2 - 1
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;
 }