
Somewhere between Boost 1.35.0 and 1.36.0, Boost.Serialization lost the ability to (de-)serialize a pointer to a class with a protected or private destructor. The problem is in extended_type_info_typeid::destroy, which tries to delete a pointer directly rather than using boost::serialization::access::destroy. This is unfortunate, because it's breaking a use of the serialization library in VTK. The patch below fixes the problem and passes all regression tests. Okay to commit to trunk and the 1.36.0 branch? - Doug Index: extended_type_info_typeid.hpp =================================================================== --- extended_type_info_typeid.hpp (revision 47849) +++ extended_type_info_typeid.hpp (working copy) @@ -28,6 +28,7 @@ #include <boost/type_traits/is_polymorphic.hpp> #include <boost/type_traits/remove_const.hpp> +#include <boost/serialization/access.hpp> #include <boost/serialization/singleton.hpp> #include <boost/serialization/extended_type_info.hpp> #include <boost/serialization/factory.hpp> @@ -113,7 +114,7 @@ public: } } void destroy(void const * const p) const{ - delete static_cast<T const *>(p) ; + boost::serialization::access::destroy(static_cast<T const *>(p)); } };