aboutsummaryrefslogtreecommitdiffstats
path: root/src/init.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-18 20:13:31 +0000
committersaturneric <[email protected]>2025-04-18 20:13:31 +0000
commit46321c6db1ec2bccdbbc19638584a3dd63cbb49b (patch)
treeba9ca11bfa2af580978738f26b62cb0ca88d662d /src/init.cpp
parentMerge branch 'develop' (diff)
downloadGpgFrontend-46321c6db1ec2bccdbbc19638584a3dd63cbb49b.tar.gz
GpgFrontend-46321c6db1ec2bccdbbc19638584a3dd63cbb49b.zip
fix: make sure gpg-agent is running after init
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 3d1f344b..312198a7 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -184,14 +184,12 @@ void ShutdownGlobalBasicEnv(const GFCxtWPtr &p_ctx) {
.toBool();
if (ctx->unit_test_mode || kill_all_gnupg_daemon_at_close) {
- const auto size = GpgContext::GetAllChannelId().size();
- for (auto i = 0; i < size; i++) {
- assert(GpgAdvancedOperator::GetInstance().KillAllGpgComponents());
+ for (const auto &channel : GpgContext::GetAllChannelId()) {
+ assert(GpgAdvancedOperator::GetInstance(channel).KillAllGpgComponents());
}
} else if (!ctx->unit_test_mode && clear_gpg_password_cache) {
- const auto size = GpgContext::GetAllChannelId().size();
- for (auto i = 0; i < size; i++) {
- assert(GpgAdvancedOperator::GetInstance().ClearGpgPasswordCache());
+ for (const auto &channel : GpgContext::GetAllChannelId()) {
+ assert(GpgAdvancedOperator::GetInstance(channel).ClearGpgPasswordCache());
}
}