Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54957 - trunk/libs/serialization/src
From: ramey_at_[hidden]
Date: 2009-07-15 02:42:14


Author: ramey
Date: 2009-07-15 02:42:12 EDT (Wed, 15 Jul 2009)
New Revision: 54957
URL: http://svn.boost.org/trac/boost/changeset/54957

Log:
Fixing error - pure virtual function call
Text files modified:
   trunk/libs/serialization/src/void_cast.cpp | 22 ++++++----------------
   1 files changed, 6 insertions(+), 16 deletions(-)

Modified: trunk/libs/serialization/src/void_cast.cpp
==============================================================================
--- trunk/libs/serialization/src/void_cast.cpp (original)
+++ trunk/libs/serialization/src/void_cast.cpp 2009-07-15 02:42:12 EDT (Wed, 15 Jul 2009)
@@ -99,7 +99,7 @@
         std::ptrdiff_t difference,
         bool includes_virtual_base
     ) :
- void_caster(derived, base, difference),
+ void_caster(derived, base, difference, true /*heap*/),
         m_includes_virtual_base(includes_virtual_base)
     {
         recursive_register(includes_virtual_base);
@@ -224,26 +224,16 @@
     void_cast_detail::set_type::iterator it;
     for(it = s.begin(); it != s.end();){
         // note item 9 from Effective STL !!!
- if((*it)->m_base == m_base && m_derived == (*it)->m_derived){
- // since recursion could invalidate it
- const void_caster * vc = *it;
- s.erase(it++);
- if(vc->is_shortcut()){
- // save pointer to set member
- // and erase first
- delete vc;
- }
- }
- else
- if( (*it)->m_base_is_destroyed
- || (*it)->m_derived_is_destroyed
+ if( (*it)->m_base == m_base && m_derived == (*it)->m_derived
+ || (*it)->m_base_observer.expired()
+ || (*it)->m_derived_observer.expired()
             || *m_derived == *(*it)->m_base
             || *(*it)->m_derived == *m_base
         ){
             // since recursion could invalidate it
             const void_caster * vc = *it;
             s.erase(it);
- if(vc->is_shortcut()){
+ if(vc->m_heap){
                 // save pointer to set member
                 // and erase first
                 delete vc;
@@ -252,7 +242,7 @@
         }
         else
             it++;
- }
+ }
 }
 
 } // namespace void_cast_detail


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk