diff --git a/Changelog b/Changelog index 4ea93f902..9f191d401 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ * Unknown - Christophe Dumez - v1.4.1 - BUGFIX: Fix problems when changing save path (if using temporary download folder) - BUGFIX: Display real save path instead of the temporary one in torrent properties + - BUGFIX: Catching invalid_handle exception to avoid rare crashes * Thu Aug 13 2009 - Christophe Dumez - v1.4.0 - FEATURE: Display swarm information in lists diff --git a/src/FinishedTorrents.cpp b/src/FinishedTorrents.cpp index 6a9868a27..9950299d4 100644 --- a/src/FinishedTorrents.cpp +++ b/src/FinishedTorrents.cpp @@ -267,6 +267,7 @@ void FinishedTorrents::on_actionSet_upload_limit_triggered(){ } void FinishedTorrents::updateTorrent(QTorrentHandle h) { + if(!h.is_valid()) return; QString hash = h.hash(); int row = getRowFromHash(hash); if(row == -1){ diff --git a/src/GUI.cpp b/src/GUI.cpp index baee36988..e67f06f5a 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -1420,6 +1420,7 @@ void GUI::updateLists(bool force) { for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) { QTorrentHandle h = QTorrentHandle(*torrentIT); if(!h.is_valid()) continue; + try { if(h.is_seed()) { // Update in finished list finishedTorrentTab->updateTorrent(h); @@ -1431,6 +1432,7 @@ void GUI::updateLists(bool force) { QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+h.hash()+".finished"); } } + } catch(invalid_handle) {} } } if(displaySpeedInTitle) { diff --git a/src/downloadingTorrents.cpp b/src/downloadingTorrents.cpp index 16829090f..b13d1b440 100644 --- a/src/downloadingTorrents.cpp +++ b/src/downloadingTorrents.cpp @@ -482,6 +482,7 @@ QStringList DownloadingTorrents::getSelectedTorrents(bool only_one) const{ // get information from torrent handles and // update download list accordingly bool DownloadingTorrents::updateTorrent(QTorrentHandle h) { + if(!h.is_valid()) return false; bool added = false; try{ QString hash = h.hash();