From 471f449017a2d3a5eefe5a9bee563a1ef18aabed Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sun, 4 Sep 2011 02:25:01 +0000 Subject: [PATCH] * Fix crash on context.restart(). Reset shader sources when shader itself is reset git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8166 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/shader/Shader.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/src/core/com/jme3/shader/Shader.java b/engine/src/core/com/jme3/shader/Shader.java index db64a05bf..e86eb4276 100644 --- a/engine/src/core/com/jme3/shader/Shader.java +++ b/engine/src/core/com/jme3/shader/Shader.java @@ -206,11 +206,11 @@ public final class Shader extends GLObject implements Savable { } public void deleteObject(Renderer r){ - r.deleteShaderSource(this); + r.deleteShaderSource(ShaderSource.this); } public GLObject createDestructableClone(){ - return new ShaderSource(this); + return new ShaderSource(ShaderSource.this); } } @@ -427,9 +427,12 @@ public final class Shader extends GLObject implements Savable { public void resetObject() { this.id = -1; this.usable = false; + + for (ShaderSource source : shaderList){ + source.resetObject(); + } + setUpdateNeeded(); - // Already done by the call above - //resetLocations(); } @Override