소스 검색

Delete shader in case compilation fails

Ray 3 달 전
부모
커밋
b677376088
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/rlgl.h

+ 3 - 0
src/rlgl.h

@@ -4178,6 +4178,9 @@ unsigned int rlCompileShader(const char *shaderCode, int type)
             RL_FREE(log);
         }
 
+        // Unload object allocated by glCreateShader(), 
+        // despite failing in the compilation process
+        glDeleteShader(shader);
         shader = 0;
     }
     else