Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions roofit/roofitcore/src/RooGenProdProj.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ RooAbsReal* RooGenProdProj::makeIntegral(const char* name, const RooArgSet& comp
// normalization.
RooArgSet emptyNormSet{};

RooArgSet keepAlive;

for (const auto pdfAsArg : compSet) {
auto pdf = static_cast<const RooAbsPdf*>(pdfAsArg);

Expand All @@ -183,8 +185,8 @@ RooAbsReal* RooGenProdProj::makeIntegral(const char* name, const RooArgSet& comp
// Remove analytically integratable observables from numeric integration list
numIntSet.remove(anaSet) ;

// Declare ownership of integral
saveSet.addOwned(std::move(pai));
// Keep integral alive until the prodSet is cloned later
keepAlive.addOwned(std::move(pai));
} else {
// Analytic integration of factorizable observable not possible, add straight pdf to product
prodSet.add(*pdf) ;
Expand Down