From 828c8071f62ac7b3439a82231c8a6c76e6f2d3ac Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sun, 25 Mar 2012 19:28:05 +0000 Subject: [PATCH] * Fix BufferUtils.destroyDirectBuffer() in OpenJDK7 git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9264 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/util/BufferUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/src/core/com/jme3/util/BufferUtils.java b/engine/src/core/com/jme3/util/BufferUtils.java index 2e59e9787..3e2c556d6 100644 --- a/engine/src/core/com/jme3/util/BufferUtils.java +++ b/engine/src/core/com/jme3/util/BufferUtils.java @@ -1177,6 +1177,10 @@ public final class BufferUtils { cleanerMethod = loadMethod("sun.nio.ch.DirectBuffer", "cleaner"); cleanMethod = loadMethod("sun.misc.Cleaner", "clean"); viewedBufferMethod = loadMethod("sun.nio.ch.DirectBuffer", "viewedBuffer"); + if (viewedBufferMethod == null){ + // They changed the name in Java 7 (???) + viewedBufferMethod = loadMethod("sun.nio.ch.DirectBuffer", "attachment"); + } // Apache Harmony freeMethod = loadMethod("org.apache.harmony.nio.internal.DirectBuffer", "free");