From 8f9af7f87f4f59f2e9912379e9be4e8a73269c9e Mon Sep 17 00:00:00 2001 From: saturneric Date: Sat, 19 Apr 2025 00:05:19 +0200 Subject: fix: solve found issues on windows --- src/core/function/gpg/GpgContext.cpp | 2 +- src/init.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/function/gpg/GpgContext.cpp b/src/core/function/gpg/GpgContext.cpp index 1960960f..7c7cde3d 100644 --- a/src/core/function/gpg/GpgContext.cpp +++ b/src/core/function/gpg/GpgContext.cpp @@ -108,7 +108,7 @@ class GpgAgentProcess { if (process_.state() != QProcess::NotRunning) { qInfo() << "killing gpg-agent, channel: " << channel_; process_.terminate(); - if (!process_.waitForFinished(5000)) { + if (!process_.waitForFinished(3000)) { process_.kill(); process_.waitForFinished(); } diff --git a/src/init.cpp b/src/init.cpp index ee19553a..944099c0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -175,6 +175,11 @@ void ShutdownGlobalBasicEnv(const GFCxtWPtr &p_ctx) { return; } + // On window platform, the gpg-agent is running as a subprocess. It will be + // closed automatically when the application is closing. + +#if !defined(_WIN32) && !defined(WIN32) + auto clear_gpg_password_cache = GetSettings().value("basic/clear_gpg_password_cache", false).toBool(); @@ -193,6 +198,8 @@ void ShutdownGlobalBasicEnv(const GFCxtWPtr &p_ctx) { } } +#endif + // first should shutdown the module system GpgFrontend::Module::ShutdownGpgFrontendModules(); -- cgit v1.2.3