diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java index d72a1d90..2b8b6315 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java @@ -111,7 +111,7 @@ public class FernFlowerDecompiler extends AbstractDecompiler { //cleanup temp files if(tempFile != null) - tempFile.delete(); + tempFile.cleanup(); } return FERNFLOWER + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java index 208036a5..d2d78683 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/TempFile.java @@ -1,5 +1,7 @@ package the.bytecode.club.bytecodeviewer.util; +import the.bytecode.club.bytecodeviewer.Constants; + import java.io.File; import java.util.HashSet; @@ -59,8 +61,11 @@ public class TempFile createdFilePaths.add(file.getAbsolutePath()); } - public void delete() + public void cleanup() { + if(!Constants.DECOMPILERS_AUTOMATICALLY_CLEANUP) + return; + //delete all the items for(String path : createdFilePaths) {