X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2FSaveConfig.java;h=6c0e4d089cedcfc43e9b17ef7f5c0f328efcd6fb;hp=125b4b7496b0558c487cf87c2f63a83fbd2fae70;hb=f35b6d628f68e3b5ef19965ad8988d0dd1eb8efa;hpb=3745d70b1427bb8ac1a085e47cbdc566936784e1 diff --git a/tim/prune/function/SaveConfig.java b/tim/prune/function/SaveConfig.java index 125b4b7..6c0e4d0 100644 --- a/tim/prune/function/SaveConfig.java +++ b/tim/prune/function/SaveConfig.java @@ -135,14 +135,19 @@ public class SaveConfig extends GenericFunction if (response == JFileChooser.APPROVE_OPTION) { File saveFile = chooser.getSelectedFile(); + FileOutputStream outStream = null; try { - Config.getAllConfig().store(new FileOutputStream(saveFile), "Prune config file"); + outStream = new FileOutputStream(saveFile); + Config.getAllConfig().store(outStream, "Prune config file"); } catch (IOException ioe) { _app.showErrorMessageNoLookup(getNameKey(), I18nManager.getText("error.save.failed") + " : " + ioe.getMessage()); } + finally { + try {outStream.close();} catch (Exception e) {} + } } _dialog.dispose(); _dialog = null;