Browse Source

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

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
f7f4d1333b
  1. 8
      src/main.cpp

8
src/main.cpp

@ -72,6 +72,13 @@ void sigsegvHandler(int) {
std::raise(SIGINT); std::raise(SIGINT);
std::abort(); 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 #endif
void useStyle(QApplication *app, int style){ void useStyle(QApplication *app, int style){
@ -189,6 +196,7 @@ int main(int argc, char *argv[]){
app->setApplicationName(QString::fromUtf8("qBittorrent")); app->setApplicationName(QString::fromUtf8("qBittorrent"));
app->setQuitOnLastWindowClosed(false); app->setQuitOnLastWindowClosed(false);
#ifndef Q_WS_WIN #ifndef Q_WS_WIN
signal(SIGABRT, sigabrtHandler);
signal(SIGTERM, sigtermHandler); signal(SIGTERM, sigtermHandler);
signal(SIGSEGV, sigsegvHandler); signal(SIGSEGV, sigsegvHandler);
#endif #endif

Loading…
Cancel
Save