Skip to content

Fix a memory leak in the SIOReader#221

Merged
tmadlener merged 3 commits intomasterfrom
fix-leak
Mar 2, 2026
Merged

Fix a memory leak in the SIOReader#221
tmadlener merged 3 commits intomasterfrom
fix-leak

Conversation

@jmcarcell
Copy link
Contributor

@jmcarcell jmcarcell commented Mar 2, 2026

BEGINRELEASENOTES

  • Make _currentEvent and _currentRun be std::unique_ptr so that they are deleted in the destructor of SIOReader since currently the previous ones are deleted when reading the next event or run header, which doesn't happen for the last event or run header.
  • Define the destructor as default. Delete the move constructor and the move assignment operator. This is already the case, it's not explicitly written.

ENDRELEASENOTES

Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

Can we make these unique_ptr? So that on event change we can simply reset and the rest is properly taken care of? Or is that too intrusive?

@jmcarcell
Copy link
Contributor Author

Done, I think this is equivalent to before.

Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

Thanks.

@tmadlener tmadlener merged commit ab0139e into master Mar 2, 2026
17 checks passed
@tmadlener tmadlener deleted the fix-leak branch March 2, 2026 10:27
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