[commit] r1574 - trunk/GME/XmlBackEnd

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Oct 3 16:05:11 CDT 2011


Author: ksmyth
Date: Mon Oct  3 16:05:11 2011
New Revision: 1574

Log:
std::map::erase invalidates the iterator

Modified:
   trunk/GME/XmlBackEnd/CoreXmlFile.cpp

Modified: trunk/GME/XmlBackEnd/CoreXmlFile.cpp
==============================================================================
--- trunk/GME/XmlBackEnd/CoreXmlFile.cpp	Mon Oct  3 16:05:00 2011	(r1573)
+++ trunk/GME/XmlBackEnd/CoreXmlFile.cpp	Mon Oct  3 16:05:11 2011	(r1574)
@@ -568,14 +568,17 @@
 
 void XmlObject::deleteSecondaryAttribs()
 {
-    for( AttribMapIter it = m_attributes.begin(); it != m_attributes.end(); ++it )
+    for( AttribMapIter it = m_attributes.begin(); it != m_attributes.end(); )
     {
         valtype_type type =it->second->getType();
         if( type!=VALTYPE_LOCK && type!=VALTYPE_POINTER && type!=VALTYPE_COLLECTION )
         {
             delete it->second;
-            m_attributes.erase(it);
+            m_attributes.erase(it++);
         }
+		else
+			++it;
+
     }
 }
 


More information about the gme-commit mailing list