From 415e896b0861d79be7aa76592e2fb92d44718590 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 22 Oct 2015 21:43:59 -0400 Subject: [PATCH] deleteDefaultShaders() does nothing --- .../processing/opengl/PGraphicsOpenGL.java | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 887db2ab6..d9cf0e4f0 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -602,16 +602,12 @@ public class PGraphicsOpenGL extends PGraphics { @Override public void dispose() { // PGraphics - super.dispose(); - if (asyncPixelReader != null) { asyncPixelReader.dispose(); asyncPixelReader = null; } - if (primaryGraphics) { - deleteDefaultShaders(); - } else { + if (!primaryGraphics) { deleteSurfaceTextures(); FrameBuffer ofb = offscreenFramebuffer; FrameBuffer mfb = multisampleFramebuffer; @@ -624,6 +620,8 @@ public class PGraphicsOpenGL extends PGraphics { } pgl.dispose(); + + super.dispose(); } @@ -6996,20 +6994,6 @@ public class PGraphicsOpenGL extends PGraphics { } - protected void deleteDefaultShaders() { - // The default shaders contains references to the PGraphics object that - // creates them, so when restarting the renderer, those references should - // disappear. - defColorShader = null; - defTextureShader = null; - defLightShader = null; - defTexlightShader = null; - defLineShader = null; - defPointShader = null; - maskShader = null; - } - - protected PShader getPolyShader(boolean lit, boolean tex) { PShader shader; PGraphicsOpenGL ppg = getPrimaryPG();