From 0abb46e7946c66445e787c3707bf4b5d2790b868 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 23 Nov 2006 16:21:45 +0000 Subject: [PATCH] fixed extension bug, where 0-pointers would be added the the extension list --- src/session_impl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index a1c5e0dce..65315a336 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1256,7 +1256,8 @@ namespace libtorrent { namespace detail for (extension_list_t::iterator i = m_extensions.begin() , end(m_extensions.end()); i != end; ++i) { - torrent_ptr->add_extension((*i)(torrent_ptr.get())); + boost::shared_ptr tp((*i)(torrent_ptr.get())); + if (tp) torrent_ptr->add_extension(tp); } #endif @@ -1341,7 +1342,8 @@ namespace libtorrent { namespace detail for (extension_list_t::iterator i = m_extensions.begin() , end(m_extensions.end()); i != end; ++i) { - torrent_ptr->add_extension((*i)(torrent_ptr.get())); + boost::shared_ptr tp((*i)(torrent_ptr.get())); + if (tp) torrent_ptr->add_extension(tp); } #endif