Index: boost/thread/detail/memory.hpp =================================================================== --- boost/thread/detail/memory.hpp (revision 80450) +++ boost/thread/detail/memory.hpp (working copy) @@ -33,7 +33,7 @@ typedef typename alloc_traits::pointer pointer; typedef typename alloc_traits::size_type size_type; private: - _Alloc& alloc_; + _Alloc alloc_; size_type s_; public: allocator_destructor(_Alloc& a, size_type s)BOOST_NOEXCEPT @@ -41,6 +41,7 @@ {} void operator()(pointer p)BOOST_NOEXCEPT { + alloc_traits::destroy(alloc_, p); alloc_traits::deallocate(alloc_, p, s_); } }; Index: libs/thread/test/sync/futures/packaged_task/alloc_ctor_pass.cpp =================================================================== --- libs/thread/test/sync/futures/packaged_task/alloc_ctor_pass.cpp (revision 80450) +++ libs/thread/test/sync/futures/packaged_task/alloc_ctor_pass.cpp (working copy) @@ -44,20 +44,27 @@ BOOST_THREAD_COPYABLE_AND_MOVABLE(A) static int n_moves; static int n_copies; + static int n_instances; + static int n_destroy; explicit A(long i) : data_(i) { + ++n_instances; } A(BOOST_THREAD_RV_REF(A) a) : data_(BOOST_THREAD_RV(a).data_) { + ++n_instances; ++n_moves; BOOST_THREAD_RV(a).data_ = -1; } A(const A& a) : data_(a.data_) { + ++n_instances; ++n_copies; } ~A() { + --n_instances; + ++n_destroy; } long operator()() const @@ -68,6 +75,8 @@ int A::n_moves = 0; int A::n_copies = 0; +int A::n_instances = 0; +int A::n_destroy = 0; int main() { @@ -83,6 +92,8 @@ } BOOST_TEST(A::n_copies == 0); BOOST_TEST(A::n_moves > 0); + BOOST_TEST(A::n_instances == 0); + BOOST_TEST(A::n_destroy > 0); BOOST_TEST(test_alloc_base::count == 0); A::n_copies = 0; A::n_copies = 0;