Jeffery Myers 1 year ago
parent
commit
f6a3f85be2
1 changed files with 5 additions and 4 deletions
  1. 5 4
      rlImGui.cpp

+ 5 - 4
rlImGui.cpp

@@ -616,10 +616,11 @@ void ImGui_ImplRaylib_Shutdown()
     ImGuiIO& io =ImGui::GetIO();
     ImGuiIO& io =ImGui::GetIO();
     Texture2D* fontTexture = (Texture2D*)io.Fonts->TexID;
     Texture2D* fontTexture = (Texture2D*)io.Fonts->TexID;
 
 
-    if (fontTexture && fontTexture->id != 0)
-	    UnloadTexture(*fontTexture);
-
-    MemFree(fontTexture);
+    if (fontTexture)
+    {
+        UnloadTexture(*fontTexture);
+        MemFree(fontTexture);
+    }
 
 
     io.Fonts->TexID = 0;
     io.Fonts->TexID = 0;
 }
 }