mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 02:22:12 +01:00
Fixed memory leak Chunk Compression handling. Thanks Zeerix!
By: EvilSeph <evilseph@gmail.com>
This commit is contained in:
parent
d617037db6
commit
2d1f91b750
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue