replace use of deprecated shared_ptr<>::unique with shared_ptr<>::use_count
This commit is contained in:
parent
828ad7d024
commit
69d85ed110
|
@ -262,7 +262,7 @@ namespace libtorrent {
|
||||||
|
|
||||||
// we're only supposed to move part files from a fence job. i.e. no other
|
// we're only supposed to move part files from a fence job. i.e. no other
|
||||||
// disk jobs are supposed to be in-flight at this point
|
// disk jobs are supposed to be in-flight at this point
|
||||||
TORRENT_ASSERT(!m_file || m_file.unique());
|
TORRENT_ASSERT(!m_file || m_file.use_count() == 1);
|
||||||
m_file.reset();
|
m_file.reset();
|
||||||
|
|
||||||
if (!m_piece_map.empty())
|
if (!m_piece_map.empty())
|
||||||
|
|
|
@ -393,7 +393,7 @@ namespace {
|
||||||
// to keep the session_impl alive
|
// to keep the session_impl alive
|
||||||
m_impl->call_abort();
|
m_impl->call_abort();
|
||||||
|
|
||||||
if (m_thread && m_thread.unique())
|
if (m_thread && m_thread.use_count() == 1)
|
||||||
{
|
{
|
||||||
#if defined TORRENT_ASIO_DEBUGGING
|
#if defined TORRENT_ASIO_DEBUGGING
|
||||||
wait_for_asio_handlers();
|
wait_for_asio_handlers();
|
||||||
|
@ -424,7 +424,7 @@ namespace {
|
||||||
session_proxy& session_proxy::operator=(session_proxy&&) noexcept = default;
|
session_proxy& session_proxy::operator=(session_proxy&&) noexcept = default;
|
||||||
session_proxy::~session_proxy()
|
session_proxy::~session_proxy()
|
||||||
{
|
{
|
||||||
if (m_thread && m_thread.unique())
|
if (m_thread && m_thread.use_count() == 1)
|
||||||
{
|
{
|
||||||
#if defined TORRENT_ASIO_DEBUGGING
|
#if defined TORRENT_ASIO_DEBUGGING
|
||||||
wait_for_asio_handlers();
|
wait_for_asio_handlers();
|
||||||
|
|
|
@ -3153,7 +3153,7 @@ namespace aux {
|
||||||
if (!m_undead_peers.empty())
|
if (!m_undead_peers.empty())
|
||||||
{
|
{
|
||||||
auto const remove_it = std::remove_if(m_undead_peers.begin(), m_undead_peers.end()
|
auto const remove_it = std::remove_if(m_undead_peers.begin(), m_undead_peers.end()
|
||||||
, std::bind(&std::shared_ptr<peer_connection>::unique, _1));
|
, [](std::shared_ptr<peer_connection>& ptr) { return ptr.use_count() == 1; });
|
||||||
m_undead_peers.erase(remove_it, m_undead_peers.end());
|
m_undead_peers.erase(remove_it, m_undead_peers.end());
|
||||||
if (m_undead_peers.empty())
|
if (m_undead_peers.empty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue