From 23163408131b077362439ec4f898d0ad3ce084e1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 17 May 2011 19:03:11 +0200 Subject: Fix ShaderProgram double destroy() --- src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java | 6 ++++-- 1 file 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; + } } // -- cgit v1.2.3