From b5ccf05541fb9c87665e964410b9da891831897d Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 29 Aug 2007 16:15:11 +0000 Subject: [PATCH] - BUGFIX: Do not store and calculate ETA values for finished torrents --- TODO | 3 ++- src/bittorrent.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index 6d75f663f..d28936203 100644 --- a/TODO +++ b/TODO @@ -75,7 +75,7 @@ LANGUAGES UPDATED: beta5->beta6 changelog: - FEATURE: Split download tab from GUI class and cleaned up code -- FEATURE: A lot of code optimization +- FEATURE: A lot of code optimization (CPU & memory usage) - FEATURE: Added support for .ico format (useful for RSS favicons) - I18N: Updated Greek translation - BUGFIX: Made torrent deletion from hard-drive safer @@ -90,4 +90,5 @@ beta5->beta6 changelog: - BUGFIX: ETA was wrong for torrents with filtered files - BUGFIX: Display the torrent that are being checked as 'checking' in seeding list - BUGFIX: Fixed file preview and improved previewable files detection +- BUGFIX: Do not store and calculate ETA values for finished torrents - I18N: Removed no longer maintained Traditional chinese translation \ No newline at end of file diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 32d03fecc..3bee5a7e4 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -105,10 +105,9 @@ void bittorrent::handleDownloadFailure(QString url, QString reason) { } void bittorrent::updateETAs() { - std::vector handles = s->get_torrents(); - unsigned int nbHandles = handles.size(); - for(unsigned int i=0; i listEtas = ETAstats.value(hash, QList()); @@ -247,6 +246,9 @@ void bittorrent::setFinishedTorrent(QString hash) { if(index != -1) { unfinishedTorrents.removeAt(index); } + // Remove it from ETAs hash tables + ETAstats.remove(hash); + ETAs.remove(hash); } // Pause a running torrent