Skip to content

Commit faa79ef

Browse files
committed
Fix potential client memory leak in ManaNetworkHandler
(fixes #4946)
1 parent 403e566 commit faa79ef

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Xplat/src/main/java/vazkii/botania/common/handler/ManaNetworkHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private <T> void remove(Map<Level, Set<T>> map, Level level, T thing) {
106106
}
107107

108108
private <T> void add(Map<Level, Set<T>> map, Level level, T thing) {
109-
map.computeIfAbsent(level, k -> new HashSet<>()).add(thing);
109+
map.computeIfAbsent(level, k -> Collections.newSetFromMap(new WeakHashMap<>())).add(thing);
110110
}
111111

112112
@Override

web/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ In the meantime, Botania for Minecraft 1.20.1 may still receive updates for bug
3838
* Fix: Don't let Alfheim portal grab items in the tick it shuts down (e.g. for gluten reasons)
3939
* Fix: Astrolabe no longer attempts to place blocks in the player's head location while underwater
4040
* Fix: Mana bursts going through a nether portal could cause lag spikes
41+
* Fix: Potential client memory leak in ManaNetworkHandler
4142

4243
---
4344

0 commit comments

Comments
 (0)