Fix WorldClient memory leak (#9)

Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
This commit is contained in:
AlexdoruandMaya authored and GitHub committed 2025-06-03 19:00:30 +00:00
1 parent c75c509fda
commit e58530f587
2 files changed
+10 -1

No files matched your search

+3 -1
View File
@@ -52,7 +52,9 @@ object RelocationClientEventHandler {
@SubscribeEvent
def clientTick(event: TickEvent.ClientTickEvent) {
if (event.phase == TickEvent.Phase.END)
if (event.phase == TickEvent.Phase.END) {
MovementManager2.onTick(true)
MovingRenderer.onTick()
}
}
}
@@ -106,6 +106,13 @@ object MovingRenderer {
render(b.x, b.y, b.z, renderPos(s, frame))
}
def onTick() = {
if (oldWorld != null && world == null) {
oldWorld = null
renderBlocks = null
}
}
def onPreRenderTick(time: Float) {
isRendering = true
frame = time