Fix double-destruction problem with small function objects and swap(), and try to work around a GCC 4.2 issue. See #1910 for comments about the former problem from Niels Dekker.

[SVN r48627]
This commit is contained in:
Douglas Gregor
2008-09-06 03:16:25 +00:00
parent f379ef8532
commit 2fe4cc253f
3 changed files with 59 additions and 11 deletions

View File

@ -517,8 +517,8 @@ namespace boost {
{
if (!boost::detail::function::has_empty_target(f.get_pointer())) {
functor.obj_ref.obj_ptr = (void *)f.get_pointer();
functor.obj_ref.is_const = is_const<FunctionObj>::value;
functor.obj_ref.is_volatile = is_volatile<FunctionObj>::value;
functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
return true;
} else {
return false;
@ -801,6 +801,7 @@ namespace boost {
this->vtable = f.vtable;
f.vtable->manager(f.functor, this->functor,
boost::detail::function::move_functor_tag);
f.vtable = 0;
#if !defined(BOOST_NO_EXCEPTIONS)
} else {
clear();