From 5c9ef17e73f37c27245bb9f136bbfbabaf5836c2 Mon Sep 17 00:00:00 2001 From: Nehon Date: Fri, 1 Dec 2017 08:40:41 +0100 Subject: [PATCH] Fixes ReflectionAllocator for android --- .../main/java/com/jme3/util/ReflectionAllocator.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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);