diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index d9296fe53..d1accacec 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -197,6 +197,7 @@ namespace libtorrent bt_peer_connection::~bt_peer_connection() { + TORRENT_ASSERT(m_ses.is_network_thread()); } void bt_peer_connection::on_connected() diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 92bfb1bb3..a0597f702 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -918,6 +918,7 @@ namespace libtorrent TORRENT_ASSERT(!m_in_constructor); TORRENT_ASSERT(m_disconnecting); TORRENT_ASSERT(m_disconnect_started); + TORRENT_ASSERT(m_ses.is_network_thread()); #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS m_in_use = 0; @@ -950,7 +951,7 @@ namespace libtorrent // TORRENT_ASSERT(!m_ses.has_peer(this)); TORRENT_ASSERT(m_request_queue.empty()); TORRENT_ASSERT(m_download_queue.empty()); -#ifdef TORRENT_DEBUG +#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS for (aux::session_impl::torrent_map::const_iterator i = m_ses.m_torrents.begin() , end(m_ses.m_torrents.end()); i != end; ++i) TORRENT_ASSERT(!i->second->has_peer(this));