svn commit: r14779 - trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-05-20 15:33:43-0700
New Revision: 14779

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java

Log:
Make sure output file gets closed on error

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java?view=diff&rev=14779&p1=trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java&p2=trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java&r1=14778&r2=14779
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java	2008-05-20 15:33:43-0700
@@ -194,8 +194,11 @@
 	cmd.setStream(fo);
         cmd.setScale(Configuration.getInteger(
                 SaveGraphicsManager.KEY_GRAPHICS_RESOLUTION, 1));
-	cmd.actionPerformed(null);
-	fo.close();
+        try {
+            cmd.actionPerformed(null);
+        } finally {
+            fo.close();
+        }
         if (useUI) {
             ProjectBrowser.getInstance().showStatus("Wrote " + theFile);
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.