From 4f47cbdb77c537042a2ce2874f94ce0304359c3d Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 12 May 2019 19:30:57 -0700 Subject: [PATCH] Fix MC-151674 Close RegionFiles when they get evicted from cache https://bugs.mojang.com/browse/MC-151674 --- ...ose-RegionFiles-when-they-get-evicte.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Spigot-Server-Patches/0394-Fix-MC-151674-Close-RegionFiles-when-they-get-evicte.patch diff --git a/Spigot-Server-Patches/0394-Fix-MC-151674-Close-RegionFiles-when-they-get-evicte.patch b/Spigot-Server-Patches/0394-Fix-MC-151674-Close-RegionFiles-when-they-get-evicte.patch new file mode 100644 index 000000000..355115721 --- /dev/null +++ b/Spigot-Server-Patches/0394-Fix-MC-151674-Close-RegionFiles-when-they-get-evicte.patch @@ -0,0 +1,24 @@ +From dc2630e6c5d7c7668251a1f73d0f35ee01e173bb Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Sun, 12 May 2019 19:25:53 -0700 +Subject: [PATCH] Fix MC-151674 Close RegionFiles when they get evicted from + cache + +https://bugs.mojang.com/browse/MC-151674 + +diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java +index d39d49944..5a22b661b 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCache.java ++++ b/src/main/java/net/minecraft/server/RegionFileCache.java +@@ -56,7 +56,7 @@ public abstract class RegionFileCache implements AutoCloseable { + return regionfile; + } else { + if (this.cache.size() >= PaperConfig.regionFileCacheSize) { +- this.cache.removeLast(); ++ this.cache.removeLast().close(); + } + + if (!this.a.exists()) { +-- +2.21.0 +