diff options
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()); } } |