aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-16 05:12:25 +0000
committersaturneric <[email protected]>2023-12-16 05:12:25 +0000
commitc41074792f8c3b966b6d637c9e9b0ee10c5255e7 (patch)
treea20f44b3f275f69d0185a0dcf926082721db3220 /src/main.cpp
parentfix: slove threading and memory issues (diff)
downloadGpgFrontend-c41074792f8c3b966b6d637c9e9b0ee10c5255e7.tar.gz
GpgFrontend-c41074792f8c3b966b6d637c9e9b0ee10c5255e7.zip
fix: clean up envirnoment when app exits
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a8de6993..3bffe608 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -62,6 +62,7 @@ auto main(int argc, char* argv[]) -> int {
GpgFrontend::GFCxtSPtr ctx =
GpgFrontend::SecureCreateSharedObject<GpgFrontend::GpgFrontendContext>(
argc, argv);
+ auto rtn = 0;
// initialize qt resources
Q_INIT_RESOURCE(gpgfrontend);
@@ -102,9 +103,14 @@ auto main(int argc, char* argv[]) -> int {
ctx->load_default_gpg_context = false;
InitGlobalBasicalEnv(ctx, false);
- return RunTest(ctx);
+ rtn = RunTest(ctx);
+ ShutdownGlobalBasicalEnv(ctx);
+ return rtn;
}
InitGlobalBasicalEnv(ctx, true);
- return StartApplication(ctx);
+ rtn = StartApplication(ctx);
+ ShutdownGlobalBasicalEnv(ctx);
+
+ return rtn;
}