diff --git a/src/RooMultiPdf.cxx b/src/RooMultiPdf.cxx index b7c81693a01..e1bb4b083bf 100644 --- a/src/RooMultiPdf.cxx +++ b/src/RooMultiPdf.cxx @@ -28,7 +28,7 @@ RooMultiPdf::RooMultiPdf(const char *name, const char *title, RooCategory& _x, c std::unique_ptr 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;