[commit] r1712 - trunk/GME/Mga

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Dec 1 10:40:50 CST 2011


Author: ksmyth
Date: Thu Dec  1 10:40:49 2011
New Revision: 1712

Log:
Fix crash in RegNode::RemoveTree

Modified:
   trunk/GME/Mga/MgaAttribute.cpp

Modified: trunk/GME/Mga/MgaAttribute.cpp
==============================================================================
--- trunk/GME/Mga/MgaAttribute.cpp	Thu Dec  1 10:40:39 2011	(r1711)
+++ trunk/GME/Mga/MgaAttribute.cpp	Thu Dec  1 10:40:49 2011	(r1712)
@@ -845,12 +845,13 @@
 		COMTHROW(oldval->get_Map(&vmap));
 		map_type* map = (map_type*)(void*)vmap.llVal;
 
-		for (auto it = map->begin(); it != map->end(); it++)
+		for (auto it = map->begin(); it != map->end();)
 		{
 			if (wcsncmp(it->first, mypath, mypath.Length()) == 0)
 			{
-				map->erase(it);
-			}
+				map->erase(it++);
+			} else
+				it++;
 		}
 		// TODO
 		markchg();


More information about the gme-commit mailing list