fix bug in last bug fix, recursion!

This commit is contained in:
Aikar 2018-09-16 00:26:32 -04:00
parent e5986b1576
commit ac9a6783a3

View file

@ -11,7 +11,7 @@ not run on every manipulation, and instead to run clean
once per tick per expiring map.
diff --git a/src/main/java/net/minecraft/server/ExpiringMap.java b/src/main/java/net/minecraft/server/ExpiringMap.java
index 4006f5a69c..5345b97241 100644
index 4006f5a69c..3b90f6e6c3 100644
--- a/src/main/java/net/minecraft/server/ExpiringMap.java
+++ b/src/main/java/net/minecraft/server/ExpiringMap.java
@@ -0,0 +0,0 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
@ -72,9 +72,9 @@ index 4006f5a69c..5345b97241 100644
}
}
-
+ if (this.ttl.size() != this.size) {
+ if (this.ttl.size() != this.size()) {
+ MinecraftServer.LOGGER.error("WARNING: ExpiringMap desync - Memory leak risk!");
+ for (Entry<T> entry : this.entries) {
+ for (Entry<T> entry : this.long2ObjectEntrySet()) {
+ ttl.putIfAbsent(entry.getLongKey(), now);
+ }
+ }