diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx index 793c30c1e27e76900d5e536ad329a7018d8e274e..5a489e50fff7923307d830351ad71f030a1fe580 100644 --- a/Control/AthenaServices/src/AthenaOutputStream.cxx +++ b/Control/AthenaServices/src/AthenaOutputStream.cxx @@ -614,16 +614,24 @@ void AthenaOutputStream::collectAllObjects() { addItemObjects(*i); folderclids.push_back(i->id()); } + + // FIXME This is a bruteforece hack to remove items erroneously + // added somewhere in the morass of the addItemObjects logic + IDataSelector prunedList; for (auto it = m_objects.begin(); it != m_objects.end(); ++it) { - if (std::find(folderclids.begin(),folderclids.end(),(*it)->clID())==folderclids.end()) { - m_objects.erase(it); + if (std::find(folderclids.begin(),folderclids.end(),(*it)->clID())!=folderclids.end()) { + prunedList.push_back(*it); // build new list that is correct } - } - for (auto it = m_objects.begin(); it != m_objects.end(); ++it) { - if (std::find(folderclids.begin(),folderclids.end(),(*it)->clID())==folderclids.end()) { - ATH_MSG_ERROR("Object found that was not in itemlist"); + else { + ATH_MSG_DEBUG("Object " << (*it)->clID() <<","<< (*it)->name() << " found that was not in itemlist"); } } + m_objects.clear(); // clear previous list + //for (auto it = m_objects.begin(); it != m_objects.end(); ++it) { + for (auto it = prunedList.begin(); it != prunedList.end(); ++it) { + ATH_MSG_INFO("GLARB " << (*it)->clID() << " " << (*it)->name()); + m_objects.push_back(*it); // copy new into previous + } } //FIXME refactor: move this in folder. Treat as composite