Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71164 - trunk/libs/serialization/src
From: ramey_at_[hidden]
Date: 2011-04-10 13:25:42


Author: ramey
Date: 2011-04-10 13:25:39 EDT (Sun, 10 Apr 2011)
New Revision: 71164
URL: http://svn.boost.org/trac/boost/changeset/71164

Log:
fix for "delete virtual function" bug
Text files modified:
   trunk/libs/serialization/src/void_cast.cpp | 9 ++++-----
   1 files changed, 4 insertions(+), 5 deletions(-)

Modified: trunk/libs/serialization/src/void_cast.cpp
==============================================================================
--- trunk/libs/serialization/src/void_cast.cpp (original)
+++ trunk/libs/serialization/src/void_cast.cpp 2011-04-10 13:25:39 EDT (Sun, 10 Apr 2011)
@@ -290,6 +290,10 @@
     void_cast_detail::set_type::iterator it;
     for(it = s.begin(); it != s.end();){
         const void_caster * vc = *it;
+ if(vc == this){
+ s.erase(it++);
+ }
+ else
         if(vc->m_parent == this){
             s.erase(it);
             delete vc;
@@ -298,11 +302,6 @@
         else
             it++;
     }
-
- // delete this guy if he's in there
- it = s.find(this);
- if(it != s.end())
- s.erase(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