close input stream on cache hit

This commit is contained in:
danyadev committed 2026-10-11 13:03:49 +03:00
1 parent 6eed99f030
commit 3d764c434c
1 file changed
+4
@@ -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()];