diff options
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java index 2f40363d6..565b5ab1c 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java @@ -95,8 +95,10 @@ public class ShaderProgram { } allShaderCode.clear(); attachedShaderCode.clear(); - gl.glDeleteProgram(shaderProgram); - shaderProgram=-1; + if(0<=shaderProgram) { + gl.glDeleteProgram(shaderProgram); + shaderProgram=-1; + } } // |