diff options
author | saturneric <[email protected]> | 2025-04-18 20:13:31 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-04-18 20:13:31 +0000 |
commit | 46321c6db1ec2bccdbbc19638584a3dd63cbb49b (patch) | |
tree | ba9ca11bfa2af580978738f26b62cb0ca88d662d /src/init.cpp | |
parent | Merge branch 'develop' (diff) | |
download | GpgFrontend-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.cpp | 10 |
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()); } } |