From b6773760887ed63f8856e3a29a5fe26391a33fc2 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 22 Jun 2025 23:52:34 +0200 Subject: [PATCH] Delete shader in case compilation fails --- src/rlgl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rlgl.h b/src/rlgl.h index c39d096fb..2562ad45d 100644 --- a/src/rlgl.h +++ b/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