- BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop

This commit is contained in:
Christophe Dumez
2010-01-03 14:41:28 +00:00
parent 893b7bf7f3
commit facbb650d0
2 changed files with 7 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.0.6 * Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.0.6
- BUGFIX: Fix detection of invalid torrent files - BUGFIX: Fix detection of invalid torrent files
- BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop
* Web Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5 * Web Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5
- BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces - BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces

View File

@@ -62,10 +62,13 @@ QApplication *app;
#ifndef Q_WS_WIN #ifndef Q_WS_WIN
void sigtermHandler(int) { void sigtermHandler(int) {
signal(SIGTERM, 0);
qDebug("Catching SIGTERM, exiting cleanly"); qDebug("Catching SIGTERM, exiting cleanly");
app->exit(); app->exit();
} }
void sigsegvHandler(int) { void sigsegvHandler(int) {
signal(SIGABRT, 0);
signal(SIGSEGV, 0);
std::cerr << "\n\n*************************************************************\n"; std::cerr << "\n\n*************************************************************\n";
std::cerr << "Catching SIGSEGV, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n"; std::cerr << "Catching SIGSEGV, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n";
print_stacktrace(); print_stacktrace();
@@ -73,6 +76,8 @@ void sigsegvHandler(int) {
std::abort(); std::abort();
} }
void sigabrtHandler(int) { void sigabrtHandler(int) {
signal(SIGABRT, 0);
signal(SIGSEGV, 0);
std::cerr << "\n\n*************************************************************\n"; std::cerr << "\n\n*************************************************************\n";
std::cerr << "Catching SIGABRT, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n"; std::cerr << "Catching SIGABRT, please report a bug at http://bug.qbittorrent.org\nand provide the following backtrace:\n";
print_stacktrace(); print_stacktrace();
@@ -210,6 +215,7 @@ int main(int argc, char *argv[]){
delete splash; delete splash;
} }
int ret = app->exec(); int ret = app->exec();
signal(SIGTERM, 0);
delete window; delete window;
qDebug("GUI was deleted!"); qDebug("GUI was deleted!");
qDebug("Deleting app..."); qDebug("Deleting app...");