2020-09-10 20:35:41 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Ivan Pekov <ivan@mrivanplays.com>
|
|
|
|
Date: Thu, 10 Sep 2020 21:02:26 +0300
|
|
|
|
Subject: [PATCH] Fix LightEngineThreaded memory leak
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
2021-02-08 16:31:51 +01:00
|
|
|
index 001ac05cf26237eec8a77c476e678ff6d0840311..7b4935dd8c54f5fcb4f26b96c270d3e4102133a3 100644
|
2020-09-10 20:35:41 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java
|
2021-01-21 11:58:52 +01:00
|
|
|
@@ -110,6 +110,8 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
|
2020-09-10 20:35:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public final void remove(long chunkId) { pendingTasks.removeIf(task -> task.chunkId == chunkId); queueUpdate(); } // Yatopia
|
|
|
|
+
|
|
|
|
public final boolean isEmpty() {
|
|
|
|
return this.size == 0 && this.pendingTasks.isEmpty();
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
2021-02-05 17:57:30 +01:00
|
|
|
index 7fa720de5c24820d2cd7eea5f74d6c1502afe461..2734b76f58401bdddf6407db7c7c445d489ad488 100644
|
2020-09-10 20:35:41 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
2021-01-21 11:58:52 +01:00
|
|
|
@@ -1792,6 +1792,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
2020-09-10 20:35:41 +02:00
|
|
|
}
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
+ chunkProvider.getLightEngine().queue.remove(chunk.getPos().pair()); // Yatopia - unregister from light queue
|
|
|
|
}
|
|
|
|
|
|
|
|
public void unregisterEntity(Entity entity) {
|