X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FMain.java;h=522aa4c4a9b95d631edcae8c922b2ca6f99f0ddb;hb=ea76fef20c86c59429a211b1566ed270de270fc1;hp=53c4a8629f952075f4519131f5541363f5701f45;hpb=826e45696764433b7b46e83143c2259f416c3b61;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index 53c4a86..522aa4c 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -354,27 +354,19 @@ public class Main { } } - // We cannot do it when in GUI mode, because it is async... - // So if we close the temp files before it is actually used, - // we have a problem... - // TODO: close it at the correct time (for now, finalize try to do it) - if (false) { - try { - Instance.getTempFiles().close(); - } catch (IOException e) { - Instance.getTraceHandler().error( - new IOException( - "Cannot dispose of the temporary files", e)); - } + try { + Instance.getTempFiles().close(); + } catch (IOException e) { + Instance.getTraceHandler() + .error(new IOException( + "Cannot dispose of the temporary files", e)); } if (exitCode == 255) { syntax(false); } - if (exitCode != 0) { - System.exit(exitCode); - } + System.exit(exitCode); } /** @@ -462,7 +454,7 @@ public class Main { } /** - * Start the CLI reader for this {@link Story}. + * Start the current reader for this {@link Story}. * * @param story * the LUID of the {@link Story} in the {@link LocalLibrary} @@ -488,7 +480,7 @@ public class Main { if (chapString != null) { try { reader.setChapter(Integer.parseInt(chapString)); - reader.read(); + reader.read(true); } catch (NumberFormatException e) { Instance.getTraceHandler().error( new IOException("Chapter number cannot be parsed: " @@ -496,7 +488,7 @@ public class Main { return 2; } } else { - reader.read(); + reader.read(true); } } catch (IOException e) { Instance.getTraceHandler().error(e); @@ -548,7 +540,8 @@ public class Main { BasicSupport support = BasicSupport.getSupport(source); if (support != null) { - Instance.getTraceHandler().trace("Support found: " + support.getClass()); + Instance.getTraceHandler().trace( + "Support found: " + support.getClass()); Progress pgIn = new Progress(); Progress pgOut = new Progress(); if (pg != null) {