diff --git a/arduino-core/src/cc/arduino/utils/network/FileDownloader.java b/arduino-core/src/cc/arduino/utils/network/FileDownloader.java index 4d090283d..2702767db 100644 --- a/arduino-core/src/cc/arduino/utils/network/FileDownloader.java +++ b/arduino-core/src/cc/arduino/utils/network/FileDownloader.java @@ -207,8 +207,10 @@ public class FileDownloader extends Observable { file.write(buffer, 0, read); setDownloaded(getDownloaded() + read); - if (Thread.interrupted()) + if (Thread.interrupted()) { + file.close(); throw new InterruptedException(); + } } if (getDownloadSize() != null) {