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);