Fix possible crash when adding a tracker to a magnet torrent without metadata (Closes #1034254)

This commit is contained in:
Christophe Dumez
2012-08-10 11:18:37 +03:00
parent 81b0a7f785
commit 8104c41332
4 changed files with 39 additions and 20 deletions

View File

@@ -28,6 +28,7 @@
* Contact : chris@qbittorrent.org
*/
#include <QDebug>
#include "sessionapplication.h"
SessionApplication::SessionApplication(const QString &id, int &argc, char **argv) :
@@ -42,3 +43,13 @@ void SessionApplication::commitData(QSessionManager & manager) {
Q_UNUSED(manager);
emit sessionIsShuttingDown();
}
bool SessionApplication::notify(QObject* receiver, QEvent* event) {
try {
return QApplication::notify(receiver, event);
} catch(const std::exception& e) {
qCritical() << "Exception thrown:" << e.what() << ", receiver: " << receiver->objectName();
receiver->dumpObjectInfo();
}
return false;
}