Fix memory leak in PixelDigi*Source#1358
Merged
karabowi merged 1 commit intoFairRootGroup:devfrom Feb 24, 2023
Merged
Conversation
c421982 to
91a6ced
Compare
fuhlig1
reviewed
Feb 22, 2023
fuhlig1
reviewed
Feb 22, 2023
Use valued members instead of heap objects.
91a6ced to
5b5c3a6
Compare
Comment on lines
-137
to
+132
| if (strcmp(BrName, "PixelDigis")) | ||
| *obj = (TObject*)fDigis; | ||
| else if (strcmp(BrName, "EventHeader.")) | ||
| *obj = (TObject*)fEventHeader; | ||
| if (strcmp(BrName, "PixelDigis") == 0) | ||
| *obj = &fDigis; | ||
| else if (strcmp(BrName, "EventHeader.") == 0) | ||
| *obj = &fEventHeader; |
Member
Author
There was a problem hiding this comment.
The previous strcmp usage here looks like a bug to me! I wonder, why this worked at all before? Or is it not called at all?
Collaborator
There was a problem hiding this comment.
Probably a bug, we are not testing this anywhere, I think.
Member
Author
There was a problem hiding this comment.
Just a wild guess:
The Register that happens in ::Init seeds FairRootManager enough, so that GetObject will not try to Activate?
karabowi
approved these changes
Feb 24, 2023
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use valued members instead of heap objects.
FairRootManager::GetObject uses FairSource::ActivateObject as a backend. Let's start and fix the memory handling there.
Checklist: