From 129cbac2c2772d70406ceb0e318a1c2481a9e679 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 22 Oct 2015 21:36:27 -0400 Subject: [PATCH] delete the surfaces only when disposing an offscreen graphics --- core/src/processing/opengl/PGraphicsOpenGL.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index f42c0473d..887db2ab6 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -609,10 +609,10 @@ public class PGraphicsOpenGL extends PGraphics { asyncPixelReader = null; } - deleteSurfaceTextures(); if (primaryGraphics) { deleteDefaultShaders(); } else { + deleteSurfaceTextures(); FrameBuffer ofb = offscreenFramebuffer; FrameBuffer mfb = multisampleFramebuffer; if (ofb != null) { @@ -6999,7 +6999,7 @@ 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 - // dissapear. + // disappear. defColorShader = null; defTextureShader = null; defLightShader = null;