Re: [Boost-bugs] [Boost C++ Libraries] #1714: crash due to new shared_from_this code

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1714: crash due to new shared_from_this code
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-03-25 15:12:24


#1714: crash due to new shared_from_this code
--------------------------------------+-------------------------------------
  Reporter: dave | Owner: fmhess
      Type: Bugs | Status: new
 Milestone: Boost 1.36.0 | Component: smart_ptr
   Version: Boost Development Trunk | Severity: Regression
Resolution: | Keywords:
--------------------------------------+-------------------------------------
Changes (by pdimov):

 * cc: pdimov (added)

Comment:

 This is likely caused by the fact that _internal_accept_owner doesn't
 check whether _owned isn't already true. The following simpler test also
 crashes:

 {{{
 #include <boost/shared_ptr.hpp>
 #include <boost/enable_shared_from_this.hpp>

 struct X: public boost::enable_shared_from_this< X >
 {
 };

 struct null_deleter
 {
     void operator()( void const* ) const
     {
     }
 };

 int main()
 {
     boost::shared_ptr<X> px( new X );
     boost::shared_ptr<X> px2( px.get(), null_deleter() );
 }
 }}}

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1714#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC