]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fileconf.cpp
I seem to have fixed the DeleteSubGroups() bug - PLEASE CHECK!
[wxWidgets.git] / src / common / fileconf.cpp
index cf8ad6879af2862b4cfc8079eacb2d6875254855..8c6ddeac2e6df86048e051957a50bf8dad1612a9 100644 (file)
@@ -1106,11 +1106,18 @@ bool ConfigGroup::DeleteSubgroup(ConfigGroup *pGroup)
   }
 
   // and subgroups of this sungroup
+#if 0
+  // pGroup->m_aSubgroups.Count() gets decremented in DeleteSubgroup(),
+  // so we cannot do this.
+                        
   nCount = pGroup->m_aSubgroups.Count();
   for ( size_t nGroup = 0; nGroup < nCount; nGroup++ ) {
     pGroup->DeleteSubgroup(pGroup->m_aSubgroups[nGroup]);
   }
-
+#endif
+  while(pGroup->m_aSubgroups.Count() > 0)
+     pGroup->DeleteSubgroup(pGroup->m_aSubgroups[0]);
+     
   LineList *pLine = pGroup->m_pLine;
   if ( pLine != NULL ) {
     // notice that we may do this test inside the previous "if" because the