mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
- BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop
This commit is contained in:
@@ -62,10 +62,13 @@ QApplication *app;
|
||||
|
||||
#ifndef Q_WS_WIN
|
||||
void sigtermHandler(int) {
|
||||
signal(SIGTERM, 0);
|
||||
qDebug("Catching SIGTERM, exiting cleanly");
|
||||
app->exit();
|
||||
}
|
||||
void sigsegvHandler(int) {
|
||||
signal(SIGABRT, 0);
|
||||
signal(SIGSEGV, 0);
|
||||
std::cerr << "\n\n*************************************************************\n";
|
||||
std::cerr << "Catching SIGSEGV, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n";
|
||||
print_stacktrace();
|
||||
@@ -73,6 +76,8 @@ void sigsegvHandler(int) {
|
||||
std::abort();
|
||||
}
|
||||
void sigabrtHandler(int) {
|
||||
signal(SIGABRT, 0);
|
||||
signal(SIGSEGV, 0);
|
||||
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();
|
||||
@@ -210,6 +215,7 @@ int main(int argc, char *argv[]){
|
||||
delete splash;
|
||||
}
|
||||
int ret = app->exec();
|
||||
signal(SIGTERM, 0);
|
||||
delete window;
|
||||
qDebug("GUI was deleted!");
|
||||
qDebug("Deleting app...");
|
||||
|
||||
Reference in New Issue
Block a user