Skip to content

Commit f26cc04

Browse files
committed
Fixed memory leaks in FlowContainer
1 parent 439e7b1 commit f26cc04

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

PWGCF/GenericFramework/Core/FlowContainer.cxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,14 @@ TH1D* FlowContainer::GetCorrXXVsPt(const char* order, double lminmulti, double l
438438
printf("fNbinsPt is not matching the num of found histograms");
439439
return nullptr;
440440
}
441-
TProfile* profY = rhProfSub->ProfileY("profY", minm, maxm);
441+
const TString temporaryTag = Form("%s_%s_%.3f_%.3f", fIDName.Data(), order, lminmulti, lmaxmulti);
442+
TProfile* profY = rhProfSub->ProfileY(Form("profY_%s", temporaryTag.Data()), minm, maxm);
442443
TH1D* histY = ProfToHist(profY);
443-
TH1D* hist = new TH1D("temphist", "temphist", fNbinsPt, fbinsPt);
444+
delete profY;
445+
TH1D* hist = new TH1D(Form("temphist_%s", temporaryTag.Data()), "temphist", fNbinsPt, fbinsPt);
444446
for (int ibin = 1; ibin <= hist->GetNbinsX(); ibin++) {
445447
TString bLabel = rhProfSub->GetYaxis()->GetBinLabel(ibin + ybn1 - 1);
446-
hist->GetXaxis()->SetBinLabel(ibin, bLabel.Data());
448+
// hist->GetXaxis()->SetBinLabel(ibin, bLabel.Data());
447449
hist->SetBinContent(ibin, histY->GetBinContent(ibin + ybn1 - 1));
448450
hist->SetBinError(ibin, histY->GetBinError(ibin + ybn1 - 1));
449451
}

0 commit comments

Comments
 (0)