ソースを参照

LP bug 992049: patch from Andrew Wason

Andrew Wason 13 年 前
コミット
4ced98fae9
1 ファイル変更2 行追加2 行削除
  1. 2 2
      panda/src/glstuff/glShaderContext_src.cxx

+ 2 - 2
panda/src/glstuff/glShaderContext_src.cxx

@@ -1103,14 +1103,14 @@ glsl_report_shader_errors(GSG *gsg, unsigned int shader) {
 
   gsg->_glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
 
-  if (length > 0) {
+  if (length > 1) {
     info_log = (char *) malloc(length);
     gsg->_glGetShaderInfoLog(shader, length, &num_chars, info_log);
     if (strcmp(info_log, "Success.\n") != 0) {
       GLCAT.error(false) << info_log << "\n";
     }
+    free(info_log);
   }
-  delete[] info_log;
 }
 
 ////////////////////////////////////////////////////////////////////