From 93a19833020e6a9f06e445c50f1ebfa0d63c8c8d Mon Sep 17 00:00:00 2001 From: JozsefA Date: Tue, 12 Jan 2021 22:00:24 -0800 Subject: [PATCH] maybe this actually fixes the memory leak --- .../foundation/utility/render/SafeDirectBuffer.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/utility/render/SafeDirectBuffer.java b/src/main/java/com/simibubi/create/foundation/utility/render/SafeDirectBuffer.java index 07316ff04..ffa97f6e3 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/render/SafeDirectBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/utility/render/SafeDirectBuffer.java @@ -1,9 +1,6 @@ package com.simibubi.create.foundation.utility.render; import net.minecraft.client.renderer.GLAllocation; -import org.lwjgl.system.MemoryStack; -import org.lwjgl.system.MemoryUtil; -import sun.misc.Cleaner; import sun.nio.ch.DirectBuffer; import java.nio.*; @@ -18,11 +15,7 @@ public class SafeDirectBuffer implements AutoCloseable { public void close() throws Exception { if (wrapped instanceof DirectBuffer) { - Cleaner cleaner = ((DirectBuffer) wrapped).cleaner(); - if (!cleaner.isEnqueued()) { - cleaner.clean(); - cleaner.enqueue(); - } + ((DirectBuffer) wrapped).cleaner().clean(); } }