@@ -1469,29 +1469,41 @@ static void processTagLessClasses(const ClassDef *rootCd,
1469
1469
}
1470
1470
}
1471
1471
1472
- static void findTagLessClasses (const ClassDef *cd)
1472
+ static void findTagLessClasses (std::vector<ClassDefMutable*> &candidates, const ClassDef *cd)
1473
1473
{
1474
1474
for (const auto &icd : cd->getClasses ())
1475
1475
{
1476
1476
if (icd->name ().find (" @" )==-1 ) // process all non-anonymous inner classes
1477
1477
{
1478
- findTagLessClasses (icd);
1478
+ findTagLessClasses (candidates, icd);
1479
1479
}
1480
1480
}
1481
1481
1482
- processTagLessClasses (cd,cd,toClassDefMutable (cd)," " ,0 ); // process tag less inner struct/classes (if any)
1482
+ ClassDefMutable *cdm = toClassDefMutable (cd);
1483
+ if (cdm)
1484
+ {
1485
+ candidates.push_back (cdm);
1486
+ }
1483
1487
}
1484
1488
1485
1489
static void findTagLessClasses ()
1486
1490
{
1491
+ std::vector<ClassDefMutable *> candidates;
1487
1492
for (const auto &cd : *Doxygen::classLinkedMap)
1488
1493
{
1489
1494
Definition *scope = cd->getOuterScope ();
1490
1495
if (scope && scope->definitionType ()!=Definition::TypeClass) // that is not nested
1491
1496
{
1492
- findTagLessClasses (cd.get ());
1497
+ findTagLessClasses (candidates, cd.get ());
1493
1498
}
1494
1499
}
1500
+
1501
+ // since processTagLessClasses is potentially adding classes to Doxygen::classLinkedMap
1502
+ // we need to call it outside of the loop above, otherwise the iterator gets invalidated!
1503
+ for (auto &cd : candidates)
1504
+ {
1505
+ processTagLessClasses (cd,cd,cd," " ,0 ); // process tag less inner struct/classes
1506
+ }
1495
1507
}
1496
1508
1497
1509
0 commit comments