mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-01 01:46:39 +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;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue