forked from boostorg/smart_ptr
Fixed comment to reflect the intention and the current code
[SVN r44873]
This commit is contained in:
@@ -44,10 +44,7 @@ protected:
|
|||||||
// virtual destructor because we need a vtable for dynamic_cast from base to derived to work
|
// virtual destructor because we need a vtable for dynamic_cast from base to derived to work
|
||||||
virtual ~enable_shared_from_this()
|
virtual ~enable_shared_from_this()
|
||||||
{
|
{
|
||||||
// make sure no dangling shared_ptr objects were created by the
|
BOOST_ASSERT( _shared_count.use_count() <= 1 ); // make sure no dangling shared_ptr objects exist
|
||||||
// user calling shared_from_this() but never passing ownership of the object
|
|
||||||
// to a shared_ptr.
|
|
||||||
BOOST_ASSERT( _shared_count.use_count() <= 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -92,6 +89,7 @@ private:
|
|||||||
detail::sp_deleter_wrapper * pd = detail::basic_get_deleter<detail::sp_deleter_wrapper>( _shared_count );
|
detail::sp_deleter_wrapper * pd = detail::basic_get_deleter<detail::sp_deleter_wrapper>( _shared_count );
|
||||||
BOOST_ASSERT( pd != 0 );
|
BOOST_ASSERT( pd != 0 );
|
||||||
pd->set_deleter( owner.get_shared_count() );
|
pd->set_deleter( owner.get_shared_count() );
|
||||||
|
|
||||||
owner.reset( _shared_count, owner.get() );
|
owner.reset( _shared_count, owner.get() );
|
||||||
detail::shared_count().swap( _shared_count );
|
detail::shared_count().swap( _shared_count );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user