diff options
author | Saturneric <[email protected]> | 2022-01-09 20:25:12 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-09 20:25:12 +0000 |
commit | 3cff1c7d0cc46d2f10da1f7019d1478f7e0e3eaa (patch) | |
tree | d845fa4138d6ebb929116650dec3157d935520c5 /src/before_exit.cpp | |
parent | <feature>(ui, resources): add imap folder support. (diff) | |
download | GpgFrontend-3cff1c7d0cc46d2f10da1f7019d1478f7e0e3eaa.tar.gz GpgFrontend-3cff1c7d0cc46d2f10da1f7019d1478f7e0e3eaa.zip |
<fixed>(ui): fix SIGSEGV when closing.
1. Fixed the segfault problem when closing the program (problem with root certificate).
2. Added some code that is executed before the exit function is called, including releasing all the root certificates that have been loaded.
3. Optimized the preloading code of the root certificate.
Diffstat (limited to 'src/before_exit.cpp')
-rw-r--r-- | src/before_exit.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/before_exit.cpp b/src/before_exit.cpp new file mode 100644 index 00000000..ba731203 --- /dev/null +++ b/src/before_exit.cpp @@ -0,0 +1,32 @@ +/** + * This file is part of GpgFrontend. + * + * GpgFrontend is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Foobar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <https://www.gnu.org/licenses/>. + * + * The initial version of the source code is inherited from gpg4usb-team. + * Their source code version also complies with GNU General Public License. + * + * The source code version of this software was modified and released + * by Saturneric<[email protected]> starting on May 12, 2021. + * + */ + +#include <easyloggingpp/easylogging++.h> + +#include "ui/settings/GlobalSettingStation.h" + +void before_exit(int status, void *arg) { + LOG(INFO) << "called exit status" << status; + GpgFrontend::UI::GlobalSettingStation::GetInstance().ResetRootCerts(); +} |