diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 409cb488e..635e867e5 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -544,7 +544,7 @@ namespace aux { #endif , m_total_failed_bytes(0) , m_total_redundant_bytes(0) -#if defined TORRENT_DEBUG && defined BOOST_HAS_PTHREADS +#if (defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS) && defined BOOST_HAS_PTHREADS , m_network_thread(0) #endif { @@ -815,6 +815,11 @@ namespace aux { extern void get_vm_stats(vm_statistics_data_t* vm_stat); get_vm_stats(&m_last_vm_stat); + m_last_failed = 0; + m_last_redundant = 0; + m_last_uploaded = 0; + m_last_downloaded = 0; + reset_stat_counters(); rotate_stats_log(); #endif @@ -4016,7 +4021,7 @@ namespace aux { void session_impl::main_thread() { -#if defined TORRENT_DEBUG && defined BOOST_HAS_PTHREADS +#if (defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS) && defined BOOST_HAS_PTHREADS m_network_thread = pthread_self(); #endif TORRENT_ASSERT(is_network_thread()); @@ -4064,7 +4069,7 @@ namespace aux { TORRENT_ASSERT(m_torrents.empty()); TORRENT_ASSERT(m_connections.empty()); -#if defined TORRENT_DEBUG && defined BOOST_HAS_PTHREADS +#if (defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS) && defined BOOST_HAS_PTHREADS m_network_thread = 0; #endif }