Close JarFile resources in PluginWrapper and UpdateCenter

This commit is contained in:
evernat committed 2013-08-24 17:43:01 +02:00
1 parent bf7eb802d9
commit b32b38cdc9
2 files changed
+13 -5

No files matched your search

+5 -1
View File
@@ -567,7 +567,11 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
if (backup.exists()) {
try {
JarFile backupPlugin = new JarFile(backup);
return backupPlugin.getManifest().getMainAttributes().getValue("Plugin-Version");
try {
return backupPlugin.getManifest().getMainAttributes().getValue("Plugin-Version");
} finally {
backupPlugin.close();
}
} catch (IOException e) {
LOGGER.log(WARNING, "Failed to get backup version ", e);
return null;