Memory Leak: `PlayerStatusManagerClient` bad reference to `Level`
JoshieGemFinder opened this issue ยท 0 comments
Describe the bug
PlayerStatusManagerClient holds a bad reference to Level with private Level lastLevel
Since there is a constant static instance of PlayerStatusManagerClient in WatutMod, this means there is always a leaky reference to the level, even if the player has left the server or changed dimensions.
Because lastLevel is only used as a reference for checking if the player has changed levels, I recommend replacing it with a WeakReference, as this would fix the memory leak without sacrificing functionality (if the reference has expired, then you're definitely not in the same level as before).
To Reproduce
N/A
latest.log, debug.log or crash report if the other 2 arent possible
N/A
Expected behavior
N/A
Screenshots
N/A
Mod and Minecraft version:
- Version: MC 1.21.1, Watut 1.21.0-1.2.7
Additional context
N/A