From ce6d0d0065c5a65a09e2a44c9d5916910abd46df Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sat, 11 Jan 2014 13:01:40 +0000 Subject: [PATCH] Used the dipose method of native object to delete framebuffers and textures when the Fpp is cleaned up git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10981 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/post/Filter.java | 6 +++--- engine/src/core/com/jme3/post/FilterPostProcessor.java | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/engine/src/core/com/jme3/post/Filter.java b/engine/src/core/com/jme3/post/Filter.java index 7948c1531..3512d7e3e 100644 --- a/engine/src/core/com/jme3/post/Filter.java +++ b/engine/src/core/com/jme3/post/Filter.java @@ -192,10 +192,10 @@ public abstract class Filter implements Savable { } public void cleanup(Renderer r) { - r.deleteFrameBuffer(renderFrameBuffer); - r.deleteImage(renderedTexture.getImage()); + renderFrameBuffer.dispose(); + renderedTexture.getImage().dispose(); if(depthTexture!=null){ - r.deleteImage(depthTexture.getImage()); + depthTexture.getImage().dispose(); } } } diff --git a/engine/src/core/com/jme3/post/FilterPostProcessor.java b/engine/src/core/com/jme3/post/FilterPostProcessor.java index 2ac8d729b..216eb2d13 100644 --- a/engine/src/core/com/jme3/post/FilterPostProcessor.java +++ b/engine/src/core/com/jme3/post/FilterPostProcessor.java @@ -378,13 +378,14 @@ public class FilterPostProcessor implements SceneProcessor, Savable { viewPort.getCamera().setViewPort(left, right, bottom, top); viewPort.setOutputFrameBuffer(outputBuffer); viewPort = null; - renderManager.getRenderer().deleteFrameBuffer(renderFrameBuffer); + + renderFrameBuffer.dispose(); if(depthTexture!=null){ - renderManager.getRenderer().deleteImage(depthTexture.getImage()); + depthTexture.getImage().dispose(); } - renderManager.getRenderer().deleteImage(filterTexture.getImage()); + filterTexture.getImage().dispose(); if(renderFrameBufferMS != null){ - renderManager.getRenderer().deleteFrameBuffer(renderFrameBufferMS); + renderFrameBufferMS.dispose(); } for (Filter filter : filters) { filter.cleanup(renderer);