Skip to content

Commit

Permalink
use iterator in free_connection_pool
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzhumsft committed Jun 17, 2016
1 parent 5caac19 commit e29426d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Release/src/http/client/http_client_asio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ void asio_connection_pool_map::free_connection_pool(const boost::system::error_c
if (!ec)
{
std::lock_guard<std::mutex> 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);
}
}
}
Expand Down

0 comments on commit e29426d

Please sign in to comment.