mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
- Catching SIGABRT signal to attempt to display the backtrace when an assertion is hit
This commit is contained in:
parent
1c08bf054a
commit
f7f4d1333b
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue