From 3d764c434cf4c2283f25b676b339a1cb5ce7bd07 Mon Sep 17 00:00:00 2001 From: danyadev Date: Sun, 11 Oct 2026 13:03:49 +0300 Subject: [PATCH] close input stream on cache hit --- src/main/java/team/chisel/ctmlib/TextureSubmapResource.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/team/chisel/ctmlib/TextureSubmapResource.java b/src/main/java/team/chisel/ctmlib/TextureSubmapResource.java index 4137c39a..21641b8b 100644 --- a/src/main/java/team/chisel/ctmlib/TextureSubmapResource.java +++ b/src/main/java/team/chisel/ctmlib/TextureSubmapResource.java @@ -137,6 +137,10 @@ public final class TextureSubmapResource implements IResource { if (existing != null) { cells = existing; } + } else { + // generateCell and generateSubmap automatically close the stream, but we also need to close it on cache hit + resource.getInputStream() + .close(); } return cells[submap.cellX() * submap.rows() + submap.cellY()];