summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2011-08-27 00:49:35 -0400
committerEvilSeph <evilseph@gmail.com>2011-08-27 01:16:53 -0400
commite4a2177281f60b6d4f6a1cf0f3b65586a7ce3cf7 (patch)
treebfc57f1b3ab7438ddc628efa639e220102e57196 /src/main/java
parent6f8d4c3a522d331ac7ef8b3157797d651900204d (diff)
downloadcraftbukkit-e4a2177281f60b6d4f6a1cf0f3b65586a7ce3cf7.tar
craftbukkit-e4a2177281f60b6d4f6a1cf0f3b65586a7ce3cf7.tar.gz
craftbukkit-e4a2177281f60b6d4f6a1cf0f3b65586a7ce3cf7.tar.lz
craftbukkit-e4a2177281f60b6d4f6a1cf0f3b65586a7ce3cf7.tar.xz
craftbukkit-e4a2177281f60b6d4f6a1cf0f3b65586a7ce3cf7.zip
Fixed memory leak Chunk Compression handling. Thanks Zeerix!
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java b/src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java
index 7490002f..9f9cd483 100644
--- a/src/main/java/org/bukkit/craftbukkit/ChunkCompressionThread.java
+++ b/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);
+ }
}
}