From 0ac2554060518359c7cc50084e3bd76fb9065504 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 29 Dec 2008 21:22:26 +0000 Subject: [PATCH] - qBittorrent shutdown is now way faster --- Changelog | 2 ++ src/bittorrent.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index e6d07b4de..7bac360a3 100644 --- a/Changelog +++ b/Changelog @@ -14,6 +14,8 @@ - FEATURE: Added notification in WebUI when qBittorrent is not reachable - FEATURE: Rewrote folder scanning code (Now uses a filesystem watcher) - FEATURE: Added torrent deletion from hard drive function in Web UI + - BUGFIX: Made usage of fastresume data more reliable + - BUGFIX: qBittorrent shutdown is now faster - BUGFIX: Fixed several memory leaks - BUGFIX: WebUI is now working with IE7 - BUGFIX: Fixed spacing problem in toolbar when toggling its visibility diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 3d97d3cfe..ab78fd259 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -816,9 +816,12 @@ void bittorrent::saveFastResumeData() { break; } // Saving fastresume data can fail - if (dynamic_cast(a)) { + save_resume_data_failed_alert const* rda = dynamic_cast(a); + if (rda) { --num_resume_data; s->pop_alert(); + // Remove torrent from session + s->remove_torrent(rda->handle); continue; } save_resume_data_alert const* rd = dynamic_cast(a); @@ -837,6 +840,8 @@ void bittorrent::saveFastResumeData() { boost::filesystem::ofstream out(fs::path(torrentBackup.path().toUtf8().data()) / file.toUtf8().data(), std::ios_base::binary); out.unsetf(std::ios_base::skipws); bencode(std::ostream_iterator(out), *rd->resume_data); + // Remove torrent from session + s->remove_torrent(rd->handle); s->pop_alert(); } }