From 5b44b657ffa6977ac6e09beaee8f07996384137f 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:11:15 +0200 Subject: [PATCH] Remove DCCs when finished. --- 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 e3b981b..077ba9d 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -408,6 +408,7 @@ public class Core extends AbstractIdleService { File file = new File(download.filename()); file.renameTo(new File(finalDirectory, download.pack().name())); eventBus.post(new DownloadFinished(download)); + dccReceivers.remove(dccDownloadFinished.dccReceiver()); } 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); @@ -431,6 +432,7 @@ public class Core extends AbstractIdleService { try { Closeables.close(download.outputStream(), true); eventBus.post(new DownloadFailed(download)); + dccReceivers.remove(dccDownloadFailed.dccReceiver()); } catch (IOException ioe1) { /* swallow silently. */ } -- 2.7.4