From e29426d258cb88bc81f35a206587d459fde24fd8 Mon Sep 17 00:00:00 2001 From: Han Zhu Date: Fri, 17 Jun 2016 08:19:37 +0000 Subject: [PATCH] use iterator in free_connection_pool --- Release/src/http/client/http_client_asio.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Release/src/http/client/http_client_asio.cpp b/Release/src/http/client/http_client_asio.cpp index e8b9ea396a..fbd4de1eed 100644 --- a/Release/src/http/client/http_client_asio.cpp +++ b/Release/src/http/client/http_client_asio.cpp @@ -406,10 +406,10 @@ void asio_connection_pool_map::free_connection_pool(const boost::system::error_c if (!ec) { std::lock_guard lg(m_connection_pool_map_mutex); - auto &pool = m_connection_pool_map[pool_key]; - if (pool && pool.use_count() == 1) + auto it = m_connection_pool_map.find(pool_key); + if (it != m_connection_pool_map.end() && it->second.use_count() == 1) { - m_connection_pool_map.erase(pool_key); + m_connection_pool_map.erase(it); } } }