From 5773cb3843f156f4fbe33443baa8faf50b9a4fb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 11 Apr 2013 22:17:05 +0200 Subject: [PATCH] Remove downloads when they have finished, too. --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 248f765..7a35624 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -409,6 +409,7 @@ public class Core extends AbstractIdleService { file.renameTo(new File(finalDirectory, download.pack().name())); eventBus.post(new DownloadFinished(download)); dccReceivers.remove(dccDownloadFinished.dccReceiver()); + downloads.remove(download); } catch (IOException ioe1) { /* TODO - handle all the errors. */ logger.log(Level.WARNING, String.format("Could not move file %s to directory %s.", download.filename(), finalDirectory), ioe1); @@ -433,6 +434,7 @@ public class Core extends AbstractIdleService { Closeables.close(download.outputStream(), true); eventBus.post(new DownloadFailed(download)); dccReceivers.remove(dccDownloadFailed.dccReceiver()); + downloads.remove(download); } catch (IOException ioe1) { /* swallow silently. */ } -- 2.7.4