From 3763b600e4cb047ec66d0176a98fc31863a7c52f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 18 Jul 2006 16:29:35 +0000 Subject: [PATCH] added integer version defines, fixed a bug which appeared when session was closing, removed an old member function declaration from torrent_handle --- include/libtorrent/torrent_handle.hpp | 1 - include/libtorrent/version.hpp | 3 +++ src/session.cpp | 17 ++++------------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index 54b5d8a4e..79eda3407 100755 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -253,7 +253,6 @@ namespace libtorrent // marks the file with the given index as filtered // it will not be downloaded - void filter_file(int index, bool filter) const; void filter_files(std::vector const& files) const; // set the interface to bind outgoing connections diff --git a/include/libtorrent/version.hpp b/include/libtorrent/version.hpp index 473553b05..abac9267d 100755 --- a/include/libtorrent/version.hpp +++ b/include/libtorrent/version.hpp @@ -33,6 +33,9 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_VERSION_HPP_INCLUDED #define TORRENT_VERSION_HPP_INCLUDED +#define LIBTORRENT_VERSION_MAJOR 0 +#define LIBTORRENT_VERSION_MINOR 10 + #define LIBTORRENT_VERSION "0.10.0.0" #endif diff --git a/src/session.cpp b/src/session.cpp index 5f6734899..0ee1a41d7 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -996,21 +996,12 @@ namespace libtorrent { namespace detail assert(m_abort); m_abort = true; - for (connection_map::iterator i = m_connections.begin(); - i != m_connections.end(); ++i) - { - i->second->disconnect(); - } - - m_connections.clear(); + while (!m_connections.empty()) + m_connections.begin()->second->disconnect(); - for (connection_map::iterator i = m_half_open.begin(); - i != m_half_open.end(); ++i) - { - i->second->disconnect(); - } + while (!m_half_open.empty()) + m_half_open.begin()->second->disconnect(); - m_half_open.clear(); m_connection_queue.clear(); #ifndef NDEBUG