diff --git a/prism/src/prism/PrismCL.java b/prism/src/prism/PrismCL.java index 55037467..23d47aa8 100644 --- a/prism/src/prism/PrismCL.java +++ b/prism/src/prism/PrismCL.java @@ -1041,7 +1041,10 @@ public class PrismCL implements PrismModelListener mainLog.println(" during computation."); } mainLog.println(); - // Close logs (in case they are files) + + // Close log (in case they are files) + // Remove protection against closing, as here we really want to close it + mainLog.setIgnoreClose(false); mainLog.close(); } @@ -1817,6 +1820,9 @@ public class PrismCL implements PrismModelListener errorAndExit("Couldn't open log file \"" + mainLogFilename + "\""); } mainLog = log; + // we set the flag that close() should be ignored for this log, + // similar to how stdout is treated automatically + mainLog.setIgnoreClose(true); prism.setMainLog(mainLog); } else { errorAndExit("No file specified for -" + sw + " switch");