1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 23:07:59 +00:00

- Catching SIGABRT signal to attempt to display the backtrace when an assertion is hit

This commit is contained in:
Christophe Dumez 2009-11-15 10:42:03 +00:00
parent 1c08bf054a
commit f7f4d1333b

View File

@ -72,6 +72,13 @@ void sigsegvHandler(int) {
std::raise(SIGINT);
std::abort();
}
void sigabrtHandler(int) {
std::cerr << "\n\n*************************************************************\n";
std::cerr << "Catching SIGABRT, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n";
print_stacktrace();
std::raise(SIGINT);
std::abort();
}
#endif
void useStyle(QApplication *app, int style){
@ -189,6 +196,7 @@ int main(int argc, char *argv[]){
app->setApplicationName(QString::fromUtf8("qBittorrent"));
app->setQuitOnLastWindowClosed(false);
#ifndef Q_WS_WIN
signal(SIGABRT, sigabrtHandler);
signal(SIGTERM, sigtermHandler);
signal(SIGSEGV, sigsegvHandler);
#endif