1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2025-07-08 00:24:44 +02:00

Fixed resource leak from never closing the JarFile.

This commit is contained in:
GJ
2012-07-02 20:44:54 -04:00
parent 1073954550
commit bc58aff362

@ -48,11 +48,12 @@ public class SpoutStuff {
private static void writeFile(String theFileName, String theFilePath) {
try {
File currentFile = new File(theFilePath + theFileName);
JarFile jar = new JarFile(mcMMO.mcmmo);
JarEntry entry = jar.getJarEntry("resources/" + theFileName);
InputStream is = jar.getInputStream(entry);
byte[] buf = new byte[2048];
int nbRead;
@ -64,6 +65,7 @@ public class SpoutStuff {
os.flush();
os.close();
jar.close();
}
catch (FileNotFoundException e) {
e.printStackTrace();