mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
- catching invalid_handle exception to avoid rare crashes
This commit is contained in:
parent
09d8a4797d
commit
7e71de558a
22
src/GUI.cpp
22
src/GUI.cpp
@ -1431,16 +1431,20 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
||||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||||
if(!h.is_valid()) continue;
|
if(!h.is_valid()) continue;
|
||||||
if(h.is_seed()) {
|
try {
|
||||||
// Update in finished list
|
if(h.is_seed()) {
|
||||||
finishedTorrentTab->updateTorrent(h);
|
// Update in finished list
|
||||||
} else {
|
finishedTorrentTab->updateTorrent(h);
|
||||||
// Update in download list
|
} else {
|
||||||
if(downloadingTorrentTab->updateTorrent(h)) {
|
// Update in download list
|
||||||
// Torrent was added, we may need to remove it from finished tab
|
if(downloadingTorrentTab->updateTorrent(h)) {
|
||||||
finishedTorrentTab->deleteTorrent(h.hash());
|
// Torrent was added, we may need to remove it from finished tab
|
||||||
TorrentPersistentData::saveSeedStatus(h);
|
finishedTorrentTab->deleteTorrent(h.hash());
|
||||||
|
TorrentPersistentData::saveSeedStatus(h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch(invalid_handle e) {
|
||||||
|
qDebug("Caught Invalid handle exception, lucky us.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user