From 2d1f91b7501b38ab442d2647396ee51a3332c21a Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 27 Aug 2011 00:49:35 -0400 Subject: [PATCH] Fixed memory leak Chunk Compression handling. Thanks Zeerix! By: EvilSeph --- .../org/bukkit/craftbukkit/ChunkCompressionThread.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java b/paper-server/src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java index 7490002f6d..9f9cd483e8 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java @@ -98,7 +98,12 @@ public final class ChunkCompressionThread implements Runnable { private void addToPlayerQueueSize(EntityPlayer player, int amount) { synchronized (queueSizePerPlayer) { Integer count = queueSizePerPlayer.get(player); - queueSizePerPlayer.put(player, (count == null ? 0 : count) + amount); + amount += (count == null) ? 0 : count; + if (amount == 0) { + queueSizePerPlayer.remove(player); + } else { + queueSizePerPlayer.put(player, amount); + } } }