From 2bdfea42481970f6d877d597cc6c1beff082f5a8 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 3 Mar 2011 03:57:47 +0000 Subject: [PATCH] fix count for non-ip-filtered torrents --- src/torrent.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/torrent.cpp b/src/torrent.cpp index e28679ef1..a2ed4ba38 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -838,6 +838,13 @@ namespace libtorrent torrent::~torrent() { + if (!m_apply_ip_filter) + { + TORRENT_ASSERT(m_ses.m_non_filtered_torrents > 0); + --m_ses.m_non_filtered_torrents; + m_apply_ip_filter = true; + } + TORRENT_ASSERT(m_ses.is_network_thread()); // The invariant can't be maintained here, since the torrent // is being destructed, all weak references to it have been