Commit in lcsim/src/org/lcsim/util/loop on MAIN
LCIODriver.java+17-11.15 -> 1.16


lcsim/src/org/lcsim/util/loop
LCIODriver.java 1.15 -> 1.16
diff -u -r1.15 -r1.16
--- LCIODriver.java	18 Dec 2008 20:57:07 -0000	1.15
+++ LCIODriver.java	18 Dec 2008 23:15:46 -0000	1.16
@@ -85,9 +85,25 @@
 	
     private void setupWriter()
     {
+    	// Cleanup existing writer.
+    	if (writer != null)
+    	{
+    		try 
+    		{
+    			writer.flush();
+    			writer.close();
+    			writer = null;
+    		}
+    		catch (IOException x)
+    		{
+    			System.err.println(x.getMessage());
+    		}    		
+    	}
+    	
+    	// Setup new writer.
         try 
         {
-            this.writer = new LCIOWriter(outputFile); 
+            writer = new LCIOWriter(outputFile); 
         }
         catch (IOException x)
         {
CVSspam 0.2.8