mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
Handle exceptions in readAlerts()
This commit is contained in:
@@ -2159,6 +2159,7 @@ void QBtSession::readAlerts() {
|
||||
// look at session alerts and display some infos
|
||||
std::auto_ptr<alert> a = s->pop_alert();
|
||||
while (a.get()) {
|
||||
try {
|
||||
if (torrent_finished_alert* p = dynamic_cast<torrent_finished_alert*>(a.get())) {
|
||||
QTorrentHandle h(p->handle);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user