Skip to content

Conversation

@guitargeek
Copy link
Contributor

The commit 4c9c5d6 fixed the memory leaking of the RooMomentMorph(Func)ND::Grid2::_grid member by deleting it in the constructor, but it didn't consider that the copy constructor didn't make a clone of the _grid, ending up with double ownership.

Now, the copy constructor is also cloning the binnings, just like the regular constructor, and the double ownership is avoided.

Closes #12155.

The commit 4c9c5d6 fixed the memory leaking of the
`RooMomentMorph(Func)ND::Grid2::_grid` member by deleting it in the
constructor, but it didn't consider that the copy constructor didn't
make a clone of the `_grid`, ending up with double ownership.

Now, the copy constructor is also cloning the binnings, just like the
regular constructor, and the double ownership is avoided.

Closes root-project#12155.
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-ubuntu2004/python3.
See console output.

@phsft-bot
Copy link

Build failed on mac12/noimt.
Running on macphsft18.dyndns.cern.ch:/Users/sftnight/build/jenkins/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-30T11:29:44.773Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/core/base/src/TDirectory.cxx:1292:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seg fault in RooMomentMorphND for ROOT 6.29

3 participants