diff --git a/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java b/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java index 7bb8a6040..a55d7c918 100644 --- a/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java +++ b/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java @@ -151,16 +151,9 @@ public final class ReflectionAllocator implements BufferAllocator { if (viewedBuffer != null) { if (viewedBuffer instanceof Buffer) { destroyDirectBuffer((Buffer) viewedBuffer); - } else { - //on android there is an internal MemoryRef class that is returned and has a "free" method. - Method freeMethod = loadMethod(viewedBuffer.getClass().getName(), "free"); - if (freeMethod != null) { - freeMethod.invoke(viewedBuffer); - } else { - Logger.getLogger(BufferUtils.class.getName()).log(Level.SEVERE, - "Buffer cannot be destroyed: {0}, {1}", new Object[]{toBeDestroyed, viewedBuffer}); - } } + // Else nothing to do, we may be on android which has an + // internal system for freeing direct buffers } else { Logger.getLogger(BufferUtils.class.getName()).log(Level.SEVERE, "Buffer cannot be destroyed: {0}", toBeDestroyed);