Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::unique_ptr<podio::CollectionBase> to save collections in the store and fix leak in the Writer #250

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jmcarcell
Copy link
Contributor

@jmcarcell jmcarcell commented Oct 10, 2024

See #249 for the report of the leak.

BEGINRELEASENOTES

  • Use std::unique_ptr<podio::CollectionBase> for the collections in the store instead of std::shared_ptr<podio::CollectionBase>.
  • Fix leak in the Writer that otherwise would have been difficult to fix
  • Clean up FunctionalUtils.h: remove some unused overloads and change some names.

ENDRELEASENOTES

shared_ptr was supposed to be temporary until everything worked, so it was a good time to remove it.

@@ -263,6 +266,9 @@ class Writer final : public Gaudi::Functional::Consumer<void(const EventContext&

debug() << "Writing frame" << endmsg;
iosvc->getWriter().writeFrame(ptr->getData(), podio::Category::Event, m_collectionsToSave);
if (deletePtr && m_collectionsToAdd.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the condition here also checking the m_collectionsToAdd to be empty?

@jmcarcell jmcarcell changed the title Fix leak in the Writer Use std::unique_ptr<podio::CollectionBase> to save collections in the store and fix leak in the Writer Oct 11, 2024
… store

Also fix a leak in the Writer that without this change would have
been difficult to fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants