From c41074792f8c3b966b6d637c9e9b0ee10c5255e7 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 15 Dec 2023 21:12:25 -0800 Subject: fix: clean up envirnoment when app exits --- src/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') 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( 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; } -- cgit v1.2.3