Hi,
I’m trying to update my code to the latest Root version, with which comes the latest RooFit 2.95, but the attached code fails where it did not used to.
The problem comes from the lines
RooCustomizer* custNeg = new RooCustomizer(*this,“neg”) ;
custPos->setOwning(kTRUE) ;
custNeg->setOwning(kTRUE) ;
in RooAbsReal.cxx…
Commenting out the to setOwning lines solves the problem.
Or maybe the delete custPos at the end of the plotAsymOn method is not correct…
Thanks for reporting that. The updated code aimed to fix a memory leak, but it appears not to work correctly in all circumstances. I will investigate and fix this.
It turns out I did commit an earlier fix, but had also changed the ownership strategy of RooCustomizer, which undid
the effect of the fix.
A new fix has gone into the dev/roostats branch that should solve
this problem properly. I have tested your example with valgrind
to make sure there are no residual issue.
This fix will also be propagated to the first upcoming ROOT release.