VERSION: back to dev
[nikiroo-utils.git] / src / be / nikiroo / fanfix / Main.java
index 42f3924daa811bdb1bb6e121d38c01b651bf828b..1e4daa801b9b852de9bb91f0964fd7d73d176864 100644 (file)
@@ -221,6 +221,9 @@ public class Main {
                                int diff = progress.getProgress() - current;
                                current += diff;
 
+                               if (diff <= 0)
+                                       return;
+
                                StringBuilder builder = new StringBuilder();
                                for (int i = 0; i < diff; i++) {
                                        builder.append('.');
@@ -351,12 +354,18 @@ public class Main {
                        }
                }
 
-               try {
-                       Instance.getTempFiles().close();
-               } catch (IOException e) {
-                       Instance.getTraceHandler()
-                                       .error(new IOException(
-                                                       "Cannot dispose of the temporary files", e));
+               // 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));
+                       }
                }
 
                if (exitCode == 255) {