diff --git a/include/boost/smart_ptr/detail/shared_count.hpp b/include/boost/smart_ptr/detail/shared_count.hpp index f055fd0..8e1dd48 100644 --- a/include/boost/smart_ptr/detail/shared_count.hpp +++ b/include/boost/smart_ptr/detail/shared_count.hpp @@ -200,7 +200,7 @@ public: } catch( ... ) { - D()( p ); // delete p + D::operator_fn( p ); // delete p throw; } @@ -210,7 +210,7 @@ public: if( pi_ == 0 ) { - D()( p ); // delete p + D::operator_fn( p ); // delete p boost::throw_exception( std::bad_alloc() ); } @@ -286,7 +286,7 @@ public: } catch(...) { - D()( p ); + D::operator_fn( p ); if( pi_ != 0 ) { @@ -306,7 +306,7 @@ public: } else { - D()( p ); + D::operator_fn( p ); boost::throw_exception( std::bad_alloc() ); } diff --git a/include/boost/smart_ptr/make_shared_object.hpp b/include/boost/smart_ptr/make_shared_object.hpp index 89a7116..52a00ce 100644 --- a/include/boost/smart_ptr/make_shared_object.hpp +++ b/include/boost/smart_ptr/make_shared_object.hpp @@ -87,6 +87,10 @@ public: destroy(); } + static void operator_fn( T* ) // operator() can't be static + { + } + void * address() BOOST_NOEXCEPT { return storage_.data_;