Remove references to chunklist

Commit c576054539790bdeb35285f62863d74b48c0782d removed the chunklist collection stored in ChunkProviderServer, however it has been partially restored in some places by 7e1ac0a77129b169704c1e222ff2deb3ab6cd2d2.  As not all references to this were restored, this has caused the chunklist and chunks collections to become out of sync, resulting in a memory leak.
This commit is contained in:
frymaster 2013-12-18 09:29:51 +11:00 committed by md_5
parent 8ebb465bf0
commit bd5e1fbba9

View File

@ -0,0 +1,40 @@
From b2430eeec08c1b17e83a32f509b045364f20bc11 Mon Sep 17 00:00:00 2001
From: frymaster <frymaster@12700.org>
Date: Tue, 17 Dec 2013 15:54:48 +0000
Subject: [PATCH] Remove references to chunklist
Commit c576054539790bdeb35285f62863d74b48c0782d removed the chunklist collection stored in ChunkProviderServer, however it has been partially restored in some places by 7e1ac0a77129b169704c1e222ff2deb3ab6cd2d2. As not all references to this were restored, this has caused the chunklist and chunks collections to become out of sync, resulting in a memory leak.
This commit removes chunklist from ChunkProviderServer again. Fixes BUKKIT-5190
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 88853ca..b88f75c 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -30,7 +30,6 @@ public class ChunkProviderServer implements IChunkProvider {
private IChunkLoader f;
public boolean forceChunkLoad = false; // true -> false
public LongObjectHashMap<Chunk> chunks = new LongObjectHashMap<Chunk>();
- private List chunkList = new ArrayList();
public WorldServer world;
// CraftBukkit end
@@ -129,7 +128,6 @@ public class ChunkProviderServer implements IChunkProvider {
}
this.chunks.put(LongHash.toLong(i, j), chunk); // CraftBukkit
- this.chunkList.add(chunk);
chunk.addEntities();
// CraftBukkit start
@@ -307,7 +305,6 @@ public class ChunkProviderServer implements IChunkProvider {
// this.unloadQueue.remove(olong);
// this.chunks.remove(olong.longValue());
this.chunks.remove(chunkcoordinates); // CraftBukkit
- this.chunkList.remove(chunk);
}
}
// CraftBukkit end
--
1.8.3.2