From 63c6e495bd994bd7049f7053e2de1143052cf628 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 21 Feb 2014 04:30:59 +0000 Subject: [PATCH] don't use shared_from_this for session_impl --- include/libtorrent/aux_/session_impl.hpp | 1 - include/libtorrent/extensions.hpp | 2 +- src/session_impl.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp index d9900eed9..13572e847 100644 --- a/include/libtorrent/aux_/session_impl.hpp +++ b/include/libtorrent/aux_/session_impl.hpp @@ -191,7 +191,6 @@ namespace libtorrent , boost::noncopyable , initialize_timer , udp_socket_observer - , boost::enable_shared_from_this { #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING // this needs to be destructed last, since other components may log diff --git a/include/libtorrent/extensions.hpp b/include/libtorrent/extensions.hpp index 68fb88001..64c8c525a 100644 --- a/include/libtorrent/extensions.hpp +++ b/include/libtorrent/extensions.hpp @@ -217,7 +217,7 @@ namespace libtorrent { return boost::shared_ptr(); } // called when plugin is added to a session - virtual void added(boost::weak_ptr) {} + virtual void added(aux::session_impl*) {} // called when an alert is posted // alerts that are filtered are not diff --git a/src/session_impl.cpp b/src/session_impl.cpp index a5a6149fa..e2594623d 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1549,7 +1549,7 @@ namespace aux { m_ses_extensions.push_back(ext); m_alerts.add_extension(ext); - ext->added(shared_from_this()); + ext->added(this); } #endif