delete the surfaces only when disposing an offscreen graphics

This commit is contained in:
codeanticode
2015-10-22 21:36:27 -04:00
parent 1138ff5a7b
commit 129cbac2c2
@@ -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;