--- boost_1_42_0.orig/libs/serialization/src/shared_ptr_helper.cpp 2010-02-23 11:18:13.203607300 -0800 +++ boost_1_42_0/libs/serialization/src/shared_ptr_helper.cpp 2010-02-23 11:34:00.650083500 -0800 @@ -66,11 +66,13 @@ collection_type::iterator i = m_pointers->find(sp); if(i == m_pointers->end()){ - std::pair result; - shared_ptr sp(const_cast(od), void_deleter(true_type)); - result = m_pointers->insert(sp); - assert(result.second); - i = result.first; + // temp: std::pair result; + // temp: shared_ptr sp(const_cast(od), void_deleter(true_type)); + // temp: result = m_pointers->insert(sp); + // temp: assert(result.second); + // temp: i = result.first; + shared_ptr np; + return np; } od = void_upcast( *true_type, @@ -92,6 +94,22 @@ ); } +BOOST_ARCHIVE_DECL(void) +shared_ptr_helper::append(const boost::shared_ptr &sp){ + + // make tracking array if necessary + if(NULL == m_pointers) + m_pointers = new collection_type; + + collection_type::iterator i = m_pointers->find(sp); + + if(i == m_pointers->end()){ + std::pair result; + result = m_pointers->insert(sp); + assert(result.second); + } +} + // #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP BOOST_ARCHIVE_DECL(void) shared_ptr_helper::append(const boost_132::shared_ptr & t){ --- boost_1_42_0.orig/boost/archive/shared_ptr_helper.hpp 2010-02-23 11:17:51.171971100 -0800 +++ boost_1_42_0/boost/archive/shared_ptr_helper.hpp 2010-02-23 11:39:10.323602100 -0800 @@ -121,6 +121,9 @@ const boost::serialization::extended_type_info * this_type ); + BOOST_ARCHIVE_DECL(void) + append(const boost::shared_ptr &); + template struct non_polymorphic { static const boost::serialization::extended_type_info * @@ -179,10 +182,24 @@ this_type ); - s = shared_ptr( - r, - static_cast(r.get()) - ); + if (!r) + { + s.reset(t); + const void * od = void_downcast( + *true_type, + *this_type, + static_cast(t) + ); + shared_ptr sp(s, od); + append(sp); + } + else + { + s = shared_ptr( + r, + static_cast(r.get()) + ); + } //s = static_pointer_cast( // const_pointer_cast(*r)