Skip to content

Commit

Permalink
Fix memory leak in RooMultiPdf constructor
Browse files Browse the repository at this point in the history
Some RooConstVars were missing an owner.
  • Loading branch information
guitargeek authored and anigamova committed Nov 20, 2024
1 parent 0805ecc commit 7c8888a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RooMultiPdf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RooMultiPdf::RooMultiPdf(const char *name, const char *title, RooCategory& _x, c
std::unique_ptr<RooAbsCollection> nonConstVariables(variables->selectByAttrib("Constant", false));
// Isn't there a better wat to hold on to these values?
RooConstVar *tmp = new RooConstVar((std::string{"const"} + pdf->GetName()).c_str(),"",nonConstVariables->size());
corr.add(*tmp);
corr.addOwned(*tmp);
count++;
}
_oldIndex=fIndex;
Expand Down

0 comments on commit 7c8888a

Please sign in to comment.