From ce48153296feec6cd66ccdb2f6ccd5a43565049d Mon Sep 17 00:00:00 2001 From: J-RAP Date: Sat, 27 Apr 2024 00:34:08 -0600 Subject: [PATCH] we cannot use fallback because JAVA 8 :/ --- .../watermedia/api/rendering/RenderAPI.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/me/srrapero720/watermedia/api/rendering/RenderAPI.java b/src/main/java/me/srrapero720/watermedia/api/rendering/RenderAPI.java index f6306c6d..e7601c12 100644 --- a/src/main/java/me/srrapero720/watermedia/api/rendering/RenderAPI.java +++ b/src/main/java/me/srrapero720/watermedia/api/rendering/RenderAPI.java @@ -1,6 +1,5 @@ package me.srrapero720.watermedia.api.rendering; -import jdk.internal.ref.Cleaner; import me.srrapero720.watermedia.api.WaterMediaAPI; import me.srrapero720.watermedia.api.image.ImageRenderer; import me.srrapero720.watermedia.api.rendering.memory.MemoryAlloc; @@ -11,7 +10,6 @@ import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import sun.nio.ch.DirectBuffer; import java.awt.*; import java.awt.image.BufferedImage; @@ -72,14 +70,14 @@ public static void freeByteBuffer(ByteBuffer buffer) { } catch (Throwable t) { if(!buffer.isDirect()) return; try { - DirectBuffer db = (DirectBuffer) buffer; - if (db.attachment() != null) - throw new IllegalArgumentException("duplicate or slice"); - - Cleaner cleaner = db.cleaner(); - if (cleaner != null) { - cleaner.clean(); - } +// DirectBuffer db = (DirectBuffer) buffer; +// if (db.attachment() != null) +// throw new IllegalArgumentException("duplicate or slice"); +// +// Cleaner cleaner = db.cleaner(); +// if (cleaner != null) { +// cleaner.clean(); +// } } catch(Throwable ex) { LOGGER.error(IT, "Failed to delete DirectByteBuffer"); }