Index: boost/enable_shared_from_this.hpp =================================================================== --- boost/enable_shared_from_this.hpp (revision 44814) +++ boost/enable_shared_from_this.hpp (working copy) @@ -89,10 +89,9 @@ }else if( !_shared_count.empty() ) { BOOST_ASSERT( owner.unique() ); // no weak_ptrs to owner should exist either, but there's no way to check that - typedef detail::sp_deleter_wrapper D; - D * pd = static_cast( _shared_count.get_deleter( BOOST_SP_TYPEID(D) ) ); + detail::sp_deleter_wrapper * pd = detail::basic_get_deleter( _shared_count ); BOOST_ASSERT( pd != 0 ); - pd->set_deleter( owner ); + pd->set_deleter( owner.get_shared_count() ); owner.reset( _shared_count, owner.get() ); detail::shared_count().swap( _shared_count ); } Index: boost/shared_ptr.hpp =================================================================== --- boost/shared_ptr.hpp (revision 44814) +++ boost/shared_ptr.hpp (working copy) @@ -497,11 +497,6 @@ return pn < rhs.pn; } - void * _internal_get_deleter( detail::sp_typeinfo const & ti ) const - { - return pn.get_deleter( ti ); - } - // atomic access #if !defined(BOOST_SP_NO_ATOMIC_ACCESS) @@ -701,35 +696,35 @@ // g++ 2.9x doesn't allow static_cast(void *) // apparently EDG 2.38 and HP aCC A.03.35 also don't accept it -template D * basic_get_deleter(shared_ptr const & p) +template D * basic_get_deleter(shared_count const & c) { - void const * q = p._internal_get_deleter(BOOST_SP_TYPEID(D)); + void const * q = c.get_deleter(BOOST_SP_TYPEID(D)); return const_cast(static_cast(q)); } #else -template D * basic_get_deleter(shared_ptr const & p) +template D * basic_get_deleter(shared_count const & c) { - return static_cast(p._internal_get_deleter(BOOST_SP_TYPEID(D))); + return static_cast(c.get_deleter(BOOST_SP_TYPEID(D))); } #endif class sp_deleter_wrapper { - shared_ptr _deleter; + detail::shared_count _deleter; public: sp_deleter_wrapper() {} - void set_deleter(const shared_ptr &deleter) + void set_deleter(shared_count const &deleter) { _deleter = deleter; } void operator()(const void *) { BOOST_ASSERT(_deleter.use_count() <= 1); - _deleter.reset(); + detail::shared_count().swap( _deleter ); } template D* get_deleter() const @@ -742,10 +737,10 @@ template D * get_deleter(shared_ptr const & p) { - D *del = detail::basic_get_deleter(p); + D *del = detail::basic_get_deleter(p.get_shared_count()); if(del == 0) { - detail::sp_deleter_wrapper *del_wrapper = detail::basic_get_deleter(p); + detail::sp_deleter_wrapper *del_wrapper = detail::basic_get_deleter(p.get_shared_count()); // The following get_deleter method call is fully qualified because // older versions of gcc (2.95, 3.2.3) fail to compile it when written del_wrapper->get_deleter() if(del_wrapper) del = del_wrapper->::boost::detail::sp_deleter_wrapper::get_deleter();