diff --git a/k4FWCore/components/Writer.cpp b/k4FWCore/components/Writer.cpp index b5da0604..cb9d6762 100644 --- a/k4FWCore/components/Writer.cpp +++ b/k4FWCore/components/Writer.cpp @@ -156,7 +156,7 @@ class Writer final : public Gaudi::Functional::Consumername() == k4FWCore::frameLocation) { continue; } @@ -190,7 +190,7 @@ class Writer final : public Gaudi::Functional::ConsumerunregisterObject(p); + const auto sc = m_dataSvc->unregisterObject(p); if (!sc.isSuccess()) { error() << "Failed to unregister object" << endmsg; return; @@ -221,7 +221,7 @@ class Writer final : public Gaudi::Functional::ConsumerretrieveObject("/Event/" + coll, storeCollection).isFailure()) { error() << "Failed to retrieve collection " << coll << endmsg; @@ -233,12 +233,12 @@ class Writer final : public Gaudi::Functional::Consumer>*>(storeCollection); - storePtr->getData().release(); + const auto storePtr = dynamic_cast>*>(storeCollection); + [[maybe_unused]] auto releasedPtr = storePtr->getData().release(); delete storePtr; } - for (auto& coll : m_collectionsToAdd) { + for (const auto& coll : m_collectionsToAdd) { DataObject* storeCollection; if (m_dataSvc->retrieveObject("/Event/" + coll, storeCollection).isFailure()) { error() << "Failed to retrieve collection " << coll << endmsg;