From 5b66436519dba1f7761623dc20e9b6ce9f22b21f Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 19 Jun 2018 23:35:19 +0100 Subject: [PATCH] Ensure the backing of LPSubscriptionValueMaps is a WeakHashMap (#1058) --- .../luckperms/bukkit/model/server/LPSubscriptionMap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/server/LPSubscriptionMap.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/server/LPSubscriptionMap.java index 53794d7e..74d4f7cf 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/server/LPSubscriptionMap.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/server/LPSubscriptionMap.java @@ -160,14 +160,15 @@ public final class LPSubscriptionMap extends HashMap backing) { this.permission = permission; - this.backing = backing; + this.backing = new WeakHashMap<>(backing); // remove all players from the map this.backing.keySet().removeIf(p -> p instanceof Player); } public LPSubscriptionValueMap(String permission) { - this(permission, new WeakHashMap<>()); + this.permission = permission; + this.backing = new WeakHashMap<>(); } @Override