From 563bea4269da5b35a77bec00d453b1f474798283 Mon Sep 17 00:00:00 2001 From: kharlov Date: Mon, 23 Apr 2007 18:35:28 +0000 Subject: [PATCH] Memory leak fixed (Gustavo) --- PHOS/AliPHOSTrigger.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/PHOS/AliPHOSTrigger.cxx b/PHOS/AliPHOSTrigger.cxx index 470db21bb95..7cc3e501481 100644 --- a/PHOS/AliPHOSTrigger.cxx +++ b/PHOS/AliPHOSTrigger.cxx @@ -553,8 +553,10 @@ void AliPHOSTrigger::SetTriggers(const TClonesArray * ampmatrix, const Int_t iMo fIs2x2Isol = IsPatchIsolated(0, ampmatrix, iMod, mtru2, f2x2MaxAmp, static_cast(max2[1]), static_cast(max2[2])) ; //Transform digit amplitude in Raw Samples - fADCValuesLow2x2 = new Int_t[nTimeBins]; - fADCValuesHigh2x2 = new Int_t[nTimeBins]; + if (fADCValuesLow2x2 == 0) { + fADCValuesLow2x2 = new Int_t[nTimeBins]; + fADCValuesHigh2x2 = new Int_t[nTimeBins]; + } pulse->SetAmplitude(f2x2MaxAmp); pulse->SetTZero(maxtimeR2); @@ -588,8 +590,10 @@ void AliPHOSTrigger::SetTriggers(const TClonesArray * ampmatrix, const Int_t iMo fIsnxnIsol = IsPatchIsolated(1, ampmatrix, iMod, mtrun, fnxnMaxAmp, static_cast(maxn[1]), static_cast(maxn[2])) ; //Transform digit amplitude in Raw Samples - fADCValuesHighnxn = new Int_t[nTimeBins]; - fADCValuesLownxn = new Int_t[nTimeBins]; + if (fADCValuesHighnxn == 0) { + fADCValuesHighnxn = new Int_t[nTimeBins]; + fADCValuesLownxn = new Int_t[nTimeBins]; + } pulse->SetAmplitude(maxtimeRn); pulse->SetTZero(fnxnMaxAmp); @@ -673,6 +677,12 @@ void AliPHOSTrigger::Trigger() SetTriggers(amptrus,imod,ampmax2,ampmaxn) ; } + amptrus->Delete(); + delete amptrus; amptrus=0; + ampmods->Delete(); + delete ampmods; ampmods=0; + timeRtrus->Delete(); + delete timeRtrus; timeRtrus=0; //Print(); } -- 2.39.3