2014-12-07 20:26:30 +01:00
|
|
|
From c938d89461ea977f4787b37f17c1bc774005b0a6 Mon Sep 17 00:00:00 2001
|
2014-08-09 00:15:42 +02:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
Date: Fri, 8 Aug 2014 19:57:03 +1000
|
|
|
|
Subject: [PATCH] Plug WorldMap Memory Leak
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java
|
2014-11-28 02:17:45 +01:00
|
|
|
index 6bae818..a4e5294 100644
|
2014-08-09 00:15:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PersistentCollection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PersistentCollection.java
|
|
|
|
@@ -18,7 +18,7 @@ public class PersistentCollection {
|
|
|
|
|
2014-11-28 02:17:45 +01:00
|
|
|
private IDataManager b;
|
|
|
|
protected Map a = Maps.newHashMap();
|
|
|
|
- private List c = Lists.newArrayList();
|
|
|
|
+ public List c = Lists.newArrayList(); // Spigot
|
|
|
|
private Map d = Maps.newHashMap();
|
2014-08-09 00:15:42 +02:00
|
|
|
|
|
|
|
public PersistentCollection(IDataManager idatamanager) {
|
2014-11-28 02:17:45 +01:00
|
|
|
@@ -181,4 +181,4 @@ public class PersistentCollection {
|
|
|
|
return oshort.shortValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-}
|
|
|
|
+}
|
|
|
|
\ No newline at end of file
|
2014-08-09 00:15:42 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2014-12-07 20:26:30 +01:00
|
|
|
index 76340f6..b6221c6 100644
|
2014-08-09 00:15:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2014-11-30 23:16:48 +01:00
|
|
|
@@ -1081,6 +1081,23 @@ public abstract class World implements IBlockAccess {
|
2014-08-09 00:15:42 +02:00
|
|
|
entity.die();
|
|
|
|
if (entity instanceof EntityHuman) {
|
|
|
|
this.players.remove(entity);
|
|
|
|
+ // Spigot start
|
|
|
|
+ for ( Object o : worldMaps.c )
|
|
|
|
+ {
|
|
|
|
+ if ( o instanceof WorldMap )
|
|
|
|
+ {
|
|
|
|
+ WorldMap map = (WorldMap) o;
|
|
|
|
+ map.i.remove( entity );
|
2014-11-28 02:17:45 +01:00
|
|
|
+ for ( Iterator<WorldMapHumanTracker> iter = (Iterator<WorldMapHumanTracker>) map.g.iterator(); iter.hasNext(); )
|
2014-08-09 00:15:42 +02:00
|
|
|
+ {
|
|
|
|
+ if ( iter.next().trackee == entity )
|
|
|
|
+ {
|
|
|
|
+ iter.remove();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
this.everyoneSleeping();
|
2014-11-28 02:17:45 +01:00
|
|
|
this.b(entity);
|
2014-08-09 00:15:42 +02:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
|
2014-11-28 02:17:45 +01:00
|
|
|
index 49826ae..36fcb15 100644
|
2014-08-09 00:15:42 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldMap.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldMap.java
|
|
|
|
@@ -22,7 +22,7 @@ public class WorldMap extends PersistentBase {
|
|
|
|
public byte scale;
|
|
|
|
public byte[] colors = new byte[16384];
|
2014-11-28 02:17:45 +01:00
|
|
|
public List g = Lists.newArrayList();
|
|
|
|
- private Map i = Maps.newHashMap();
|
|
|
|
+ public Map i = Maps.newHashMap(); // Spigot
|
|
|
|
public Map decorations = Maps.newLinkedHashMap();
|
|
|
|
|
2014-08-09 00:15:42 +02:00
|
|
|
// CraftBukkit start
|
|
|
|
--
|
2014-11-28 02:17:45 +01:00
|
|
|
2.1.0
|
2014-08-09 00:15:42 +02:00
|
|
|
|