diff --git a/jme3-core/src/main/java/com/jme3/post/Filter.java b/jme3-core/src/main/java/com/jme3/post/Filter.java index 1eae0f1a7..0b67f8c04 100644 --- a/jme3-core/src/main/java/com/jme3/post/Filter.java +++ b/jme3-core/src/main/java/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/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java b/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java index 2ac8d729b..e18681bf3 100644 --- a/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java +++ b/jme3-core/src/main/java/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); @@ -560,4 +561,4 @@ public class FilterPostProcessor implements SceneProcessor, Savable { viewPort.setOutputFrameBuffer(renderFrameBuffer); } } - } +}