mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 13:09:11 +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
@@ -63,7 +63,10 @@ public class ServerCloneController implements ICloneHandler {
|
||||
|
||||
private Map<Integer, Map<String, NBTTagCompound>> loadOldClones(File file) throws Exception {
|
||||
Map<Integer, Map<String, NBTTagCompound>> clones = new HashMap<Integer, Map<String, NBTTagCompound>>();
|
||||
NBTTagCompound nbttagcompound1 = CompressedStreamTools.readCompressed(new FileInputStream(file));
|
||||
NBTTagCompound nbttagcompound1;
|
||||
try (FileInputStream fis = new FileInputStream(file)) {
|
||||
nbttagcompound1 = CompressedStreamTools.readCompressed(fis);
|
||||
}
|
||||
NBTTagList list = nbttagcompound1.getTagList("Data", 10);
|
||||
if (list == null) {
|
||||
return clones;
|
||||
|
||||
Reference in new issue
Block a user