1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

Fix file descriptor leak when downloads are interrupted

This fixes a java warning.
This commit is contained in:
Matthijs Kooijman 2016-01-21 17:15:42 +01:00
parent 19a9e4d5e0
commit 40e9aa17b3

View File

@ -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) {