From a64cc5c41c6bd0911f4ce8e926610f0ed000b1d7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 7 Feb 2014 17:37:00 +0200 Subject: [PATCH] Use allocator)traits<>::destroy in sp_counted_impl_pda::destroy --- include/boost/smart_ptr/detail/sp_counted_impl.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/smart_ptr/detail/sp_counted_impl.hpp b/include/boost/smart_ptr/detail/sp_counted_impl.hpp index 8702532..a7b43ae 100644 --- a/include/boost/smart_ptr/detail/sp_counted_impl.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_impl.hpp @@ -236,7 +236,16 @@ public: A2 a2( a_ ); +#if !defined( BOOST_NO_CXX11_ALLOCATOR ) + + std::allocator_traits::destroy( a2, this ); + +#else + this->~this_type(); + +#endif + a2.deallocate( this, 1 ); }