浏览代码

Setting io.LogFilename to NULL disable default LogToFile() (part of #175)

ocornut 10 年之前
父节点
当前提交
072c57b0ca
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      imgui.cpp

+ 4 - 0
imgui.cpp

@@ -4394,7 +4394,11 @@ void ImGui::LogToFile(int max_depth, const char* filename)
     if (g.LogEnabled)
     if (g.LogEnabled)
         return;
         return;
     if (!filename)
     if (!filename)
+    {
         filename = g.IO.LogFilename;
         filename = g.IO.LogFilename;
+        if (!filename)
+            return;
+    }
 
 
     g.LogFile = fopen(filename, "ab");
     g.LogFile = fopen(filename, "ab");
     if (!g.LogFile)
     if (!g.LogFile)