mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 01:02:19 +00:00
Fix memory leaks by closing streams
This commit is contained in:
1 parent
39e51bc8c2
commit
540508a2be
18 files changed
+96
-60
No files matched your search
@@ -93,8 +93,9 @@ public class ImageData {
|
||||
if (!this.isUrl) {
|
||||
try {
|
||||
IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(location);
|
||||
InputStream inputstream = iresource.getInputStream();
|
||||
this.bufferedImage = ImageIO.read(inputstream);
|
||||
try (InputStream inputstream = iresource.getInputStream()) {
|
||||
this.bufferedImage = ImageIO.read(inputstream);
|
||||
}
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user