fixed extension bug, where 0-pointers would be added the the extension list

This commit is contained in:
Arvid Norberg 2006-11-23 16:21:45 +00:00
parent 139cd9a1f0
commit 0abb46e794
1 changed files with 4 additions and 2 deletions

View File

@ -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<torrent_plugin> 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<torrent_plugin> tp((*i)(torrent_ptr.get()));
if (tp) torrent_ptr->add_extension(tp);
}
#endif