mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +01:00
Ensure the backing of LPSubscriptionValueMaps is a WeakHashMap (#1058)
This commit is contained in:
parent
379eb00b69
commit
5b66436519
@ -160,14 +160,15 @@ public final class LPSubscriptionMap extends HashMap<String, Map<Permissible, Bo
|
||||
|
||||
private LPSubscriptionValueMap(String permission, Map<Permissible, Boolean> 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
|
||||
|
Loading…
Reference in New Issue
Block a user