Browse Source

Handle exceptions in readAlerts()

adaptive-webui-19844
Christophe Dumez 12 years ago
parent
commit
81b0a7f785
  1. 5
      src/qtlibtorrent/qbtsession.cpp

5
src/qtlibtorrent/qbtsession.cpp

@ -2159,6 +2159,7 @@ void QBtSession::readAlerts() { @@ -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() { @@ -2541,6 +2542,10 @@ void QBtSession::readAlerts() {
}
}
}
} catch (const std::exception& e) {
qWarning() << "Caught exception in readAlerts(): " << e.what();
}
a = s->pop_alert();
}
}

Loading…
Cancel
Save