mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 04:49:47 -07:00
Handle exceptions in readAlerts()
This commit is contained in:
parent
e73bff817c
commit
81b0a7f785
1 changed files with 351 additions and 346 deletions
|
@ -2159,6 +2159,7 @@ void QBtSession::readAlerts() {
|
||||||
// look at session alerts and display some infos
|
// look at session alerts and display some infos
|
||||||
std::auto_ptr<alert> a = s->pop_alert();
|
std::auto_ptr<alert> a = s->pop_alert();
|
||||||
while (a.get()) {
|
while (a.get()) {
|
||||||
|
try {
|
||||||
if (torrent_finished_alert* p = dynamic_cast<torrent_finished_alert*>(a.get())) {
|
if (torrent_finished_alert* p = dynamic_cast<torrent_finished_alert*>(a.get())) {
|
||||||
QTorrentHandle h(p->handle);
|
QTorrentHandle h(p->handle);
|
||||||
if (h.is_valid()) {
|
if (h.is_valid()) {
|
||||||
|
@ -2541,6 +2542,10 @@ void QBtSession::readAlerts() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
qWarning() << "Caught exception in readAlerts(): " << e.what();
|
||||||
|
}
|
||||||
|
|
||||||
a = s->pop_alert();
|
a = s->pop_alert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue