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:
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…
x
Reference in New Issue
Block a user