diff options
author | Saturneric <[email protected]> | 2022-01-09 20:28:37 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-09 20:28:52 +0000 |
commit | d52c544f0d97020a3ada0dddbf599c97906c0b90 (patch) | |
tree | 1168cc0a6140b4a7b8a4aef7ca18284a8f92eb6c /src/main.cpp | |
parent | <fixed>(ui): fix SIGSEGV when closing. (diff) | |
download | GpgFrontend-d52c544f0d97020a3ada0dddbf599c97906c0b90.tar.gz GpgFrontend-d52c544f0d97020a3ada0dddbf599c97906c0b90.zip |
<feat ,fixed>(src): Optimize signal handlers and fix sequence errors during startup.
1. When the same signal is continuously received (three times in a row), the program exits to avoid falling into a loop.
2. The QCoreApplication should be exited after displaying the information.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 7ef2db33..cf97380a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -184,12 +184,12 @@ int main(int argc, char* argv[]) { } } else { - QApplication::exit(RESTART_CODE); QMessageBox::information( nullptr, _("A serious error has occurred"), _("Oh no! GpgFrontend caught a serious error in the software, so it " "needs to be restarted. If the problem recurs, please manually " "terminate the program and report the problem to the developer.")); + QCoreApplication::quit(); return_from_event_loop_code = RESTART_CODE; LOG(INFO) << "return_from_event_loop_code" << return_from_event_loop_code; continue; |