mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-03 19:06:27 +01:00
maybe this actually fixes the memory leak
This commit is contained in:
parent
e5b61891fc
commit
93a1983302
1 changed files with 1 additions and 8 deletions
|
@ -1,9 +1,6 @@
|
||||||
package com.simibubi.create.foundation.utility.render;
|
package com.simibubi.create.foundation.utility.render;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.GLAllocation;
|
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 sun.nio.ch.DirectBuffer;
|
||||||
|
|
||||||
import java.nio.*;
|
import java.nio.*;
|
||||||
|
@ -18,11 +15,7 @@ public class SafeDirectBuffer implements AutoCloseable {
|
||||||
|
|
||||||
public void close() throws Exception {
|
public void close() throws Exception {
|
||||||
if (wrapped instanceof DirectBuffer) {
|
if (wrapped instanceof DirectBuffer) {
|
||||||
Cleaner cleaner = ((DirectBuffer) wrapped).cleaner();
|
((DirectBuffer) wrapped).cleaner().clean();
|
||||||
if (!cleaner.isEnqueued()) {
|
|
||||||
cleaner.clean();
|
|
||||||
cleaner.enqueue();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue