mirror of https://github.com/noisymime/Arduino.git
Fix file descriptor leak when downloads are interrupted
This fixes a java warning.
This commit is contained in:
parent
19a9e4d5e0
commit
40e9aa17b3
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue