Skip to content

Commit e29426d

Browse files
committed
use iterator in free_connection_pool
1 parent 5caac19 commit e29426d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Release/src/http/client/http_client_asio.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ void asio_connection_pool_map::free_connection_pool(const boost::system::error_c
406406
if (!ec)
407407
{
408408
std::lock_guard<std::mutex> lg(m_connection_pool_map_mutex);
409-
auto &pool = m_connection_pool_map[pool_key];
410-
if (pool && pool.use_count() == 1)
409+
auto it = m_connection_pool_map.find(pool_key);
410+
if (it != m_connection_pool_map.end() && it->second.use_count() == 1)
411411
{
412-
m_connection_pool_map.erase(pool_key);
412+
m_connection_pool_map.erase(it);
413413
}
414414
}
415415
}

0 commit comments

Comments
 (0)