diff --git a/engine/src/core/com/jme3/util/BufferUtils.java b/engine/src/core/com/jme3/util/BufferUtils.java index 719d4832a..668621e6f 100644 --- a/engine/src/core/com/jme3/util/BufferUtils.java +++ b/engine/src/core/com/jme3/util/BufferUtils.java @@ -1145,18 +1145,18 @@ public final class BufferUtils { } /** - * DirectByteBuffers are garbage collected by using a phantom reference and a + * Direct buffers are garbage collected by using a phantom reference and a * reference queue. Every once a while, the JVM checks the reference queue and - * cleans the DirectByteBuffers. However, as this doesn't happen - * immediately after discarding all references to a DirectByteBuffer, it's - * easy to OutOfMemoryError yourself using DirectByteBuffers. This function - * explicitly calls the Cleaner method of a DirectByteBuffer. + * cleans the direct buffers. However, as this doesn't happen + * immediately after discarding all references to a direct buffer, it's + * easy to OutOfMemoryError yourself using direct buffers. This function + * explicitly calls the Cleaner method of a direct buffer. * * @param toBeDestroyed - * The DirectByteBuffer that will be "cleaned". Utilizes reflection. + * The direct buffer that will be "cleaned". Utilizes reflection. * */ - public static void destroyByteBuffer(Buffer toBeDestroyed) { + public static void destroyDirectBuffer(Buffer toBeDestroyed) { if (!toBeDestroyed.isDirect()) { return; diff --git a/engine/src/test/jme3test/app/TestReleaseDirectMemory.java b/engine/src/test/jme3test/app/TestReleaseDirectMemory.java index 0c8c9f1ca..7446919a7 100644 --- a/engine/src/test/jme3test/app/TestReleaseDirectMemory.java +++ b/engine/src/test/jme3test/app/TestReleaseDirectMemory.java @@ -60,7 +60,7 @@ public class TestReleaseDirectMemory extends SimpleApplication { @Override public void simpleUpdate(float tpf) { ByteBuffer buf = BufferUtils.createByteBuffer(500000); - BufferUtils.destroyByteBuffer(buf); + BufferUtils.destroyDirectBuffer(buf); } }