From 810a4c3350f99703b27b07cb198f0c753e7d01f0 Mon Sep 17 00:00:00 2001 From: Kai Boernert Date: Wed, 20 Jul 2016 10:46:37 +0200 Subject: [PATCH] fix for wrongly marking as used, thanks to AlrikG for finding this Signed-off-by: Kai Boernert --- .../src/main/java/com/jme3/util/ReflectionAllocator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 6b2c38452..49b9cd4b7 100644 --- a/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java +++ b/jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java @@ -59,8 +59,8 @@ public final class ReflectionAllocator implements BufferAllocator { viewedBufferMethod = loadMethod("sun.nio.ch.DirectBuffer", "attachment"); } - // Apache Harmony - ByteBuffer bb = BufferUtils.createByteBuffer(1); + // Apache Harmony (allocated directly, to not trigger allocator used logic in BufferUtils) + ByteBuffer bb = ByteBuffer.allocateDirect(1); Class clazz = bb.getClass(); try { freeMethod = clazz.getMethod("free");