mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-12 14:14:52 +08:00
fix memory leak (#1986)
This commit is contained in:
parent
1b5522958a
commit
7c8d75f5a4
@ -112,7 +112,10 @@ public class Texture {
|
||||
|
||||
public static Texture loadTexture(InputStream in) throws IOException {
|
||||
if (in == null) return null;
|
||||
BufferedImage img = ImageIO.read(in);
|
||||
BufferedImage img;
|
||||
try (InputStream is = in) {
|
||||
img = ImageIO.read(is);
|
||||
}
|
||||
if (img == null) {
|
||||
throw new IIOException("No image found");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user