Expand the destroyByteBuffer() call to take any
Buffer and do a safety check for isDirect(). This should let it free FloatBuffers, etc. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9120 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
b1d4c36fd7
commit
9ecaf0b96e
@ -1156,7 +1156,11 @@ public final class BufferUtils {
|
||||
* The DirectByteBuffer that will be "cleaned". Utilizes reflection.
|
||||
*
|
||||
*/
|
||||
public static void destroyByteBuffer(ByteBuffer toBeDestroyed) {
|
||||
public static void destroyByteBuffer(Buffer toBeDestroyed) {
|
||||
|
||||
if (!toBeDestroyed.isDirect()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Method cleanerMethod = toBeDestroyed.getClass().getMethod("cleaner");
|
||||
cleanerMethod.setAccessible(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user