]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/SaveConfig.java
Version 12, December 2010
[GpsPrune.git] / tim / prune / function / SaveConfig.java
index 125b4b7496b0558c487cf87c2f63a83fbd2fae70..6c0e4d089cedcfc43e9b17ef7f5c0f328efcd6fb 100644 (file)
@@ -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;