lcsim/src/org/lcsim/util/loop
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)
{