(1.12) Memory Leak: KumoVariableRegistry#tempData
Describe the bug
I'm don't fully understand what kumo variables are but from looking at it the tempData field seems to be used when an entity with Mo'Bends animations is rendered. This means the variable gets frequently updated and there shouldn't be a memory leak normally.
But what if I join a world and an entity with Mo'Bends animations gets rendered. After that I leave the world and I join another world where no entity with Mo'Bends animations exists. This means the tempData field still holds the value from the last rendered entity which causes that entity and its world to not be garbage collected.
https://github.com/mobends/MoBends/blob/3b56b02e59fcf2d8571d3fedb6ceee8f8824ba05/src/main/java/goblinbob/mobends/core/kumo/variable/KumoVariableRegistry.java#L16
To Reproduce Steps to reproduce the behavior:
- Join a world
- Let an entity with Mo'Bends animations be rendered
- Leave the world
- Join a world without any entity with Mo'Bends animations
- See a
WorldClientinstance not being garbage collected
Context (please complete the following information):
- Minecraft version: 1.12.2
- Forge version: 14.23.5.2855
- Mo' Bends version: 1.1.0