Skip to content

Commit

Permalink
Fix ClientWorld memory leak in non-terrain light cache (fixes #209)
Browse files Browse the repository at this point in the history
  • Loading branch information
comp500 committed Jul 10, 2023
1 parent 3b66ba1 commit 8dbe4f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void render(BlockRenderView blockView, BakedModel model, BlockState state

// blockInfo is thread-local, not cleaned up when leaving world (and could be called for arbitrary BlockRenderViews)
blockInfo.release();
lightCache.release();
blockInfo.random = null;
this.vertexConsumer = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ public long get(int x, int y, int z) {

return this.light[l] = this.compute(x, y, z);
}

public void release() {
this.world = null;
}
}

0 comments on commit 8dbe4f9

Please sign in to comment.