diff --git a/source/src/XMLParser.cc b/source/src/XMLParser.cc index 452a0e75..84afa29b 100644 --- a/source/src/XMLParser.cc +++ b/source/src/XMLParser.cc @@ -157,7 +157,11 @@ namespace marlin{ // preprocess groups: --------------------------------------------------------------------------------- // simply copy all group parameters to the processors // and then copy the processors to the root node - while( (section = root->IterateChildren( "group", section ) ) != 0 ){ + // 'section' comes from above as first execute child, get the next section so we + // do not cleanup the execute section in loop body below, only the groups + TiXmlNode* nextSection = root->IterateChildren("group", section); + while((section = nextSection) != 0){ + nextSection = root->IterateChildren("group", section); std::vector groupParams ; @@ -527,9 +531,10 @@ namespace marlin{ condition = aCondition ; TiXmlNode* child = 0 ; - while( ( child = current->IterateChildren( "if" , child ) ) != 0 ){ - - processconditions( child , getAttribute( child, "condition") ) ; + TiXmlNode* nextChild = current->IterateChildren("if" , child); + while((child = nextChild) != 0){ + nextChild = current->IterateChildren("if" , child); + processconditions( child , getAttribute( child, "condition") ) ; // might clean child } while( ( child = current->IterateChildren( "processor" , child ) ) != 0 ) { @@ -900,8 +905,9 @@ namespace marlin{ } TiXmlNode* child = 0 ; - while( ( child = section->IterateChildren( child ) ) != 0 ){ - + TiXmlNode* nextChild = section->IterateChildren( child ); + while((child = nextChild) != 0){ + nextChild = section->IterateChildren(child); if( std::string( child->Value() ) == "group" ) { // find group definition in root node