From 316c6cd94f218f4f522bb4f1cdc3219a07a1b7a8 Mon Sep 17 00:00:00 2001 From: hristov Date: Mon, 10 Sep 2007 06:48:11 +0000 Subject: [PATCH] Fixes for some mem-leaks: most changes where pretty basic (i.e. adding deletes). In some cases affecting AliESDEvent and AliTPCtrackerMI memory leaks introduced by placement-new were fixed. The placement-new sometimes overwrote pointers to memory allocated by the class itself.The placement-new was replaced with assigments where it was considered appropiate (for this some operator= were modified) or an explicit call to the destructor before was used. Christian --- HMPID/AliHMPIDCluster.cxx | 2 +- ITS/AliITStrackerMI.cxx | 1 + PHOS/AliPHOSTrigger.cxx | 14 +++++++++- PHOS/AliPHOSTrigger.h | 3 +- PMD/AliPMDEmpDiscriminator.cxx | 1 + PMD/AliPMDtracker.cxx | 1 + STEER/AliESDCaloTrigger.cxx | 18 ++++-------- STEER/AliESDEvent.cxx | 16 +++++++---- STEER/AliESDFMD.cxx | 7 +++-- STEER/AliESDVertex.cxx | 30 +++++++------------- STEER/AliKalmanTrack.cxx | 16 ++++++++++- STEER/AliKalmanTrack.h | 2 +- STEER/AliMagFMaps.cxx | 15 +++++++--- STEER/AliMultiplicity.cxx | 39 ++++++++++++-------------- STEER/AliVertex.cxx | 24 ++++++++-------- TPC/AliComplexCluster.cxx | 20 +++++++++++++ TPC/AliComplexCluster.h | 3 +- TPC/AliTPCseed.cxx | 45 ++++++++++++++++++++++++++++-- TPC/AliTPCtrack.cxx | 27 ++++++++++++++++++ TPC/AliTPCtrack.h | 3 +- TPC/AliTPCtrackerMI.cxx | 51 ++++++++++++++++++++-------------- 21 files changed, 229 insertions(+), 109 deletions(-) diff --git a/HMPID/AliHMPIDCluster.cxx b/HMPID/AliHMPIDCluster.cxx index 7ce3a5d68ad..28db82b7ebb 100644 --- a/HMPID/AliHMPIDCluster.cxx +++ b/HMPID/AliHMPIDCluster.cxx @@ -144,7 +144,7 @@ void AliHMPIDCluster::FitFunc(Int_t &iNpars, Double_t* deriv, Double_t &chi2, Do } } //delete array... - for(Int_t i=0;iReset(); // CKB no clear/reset implemented if(fSPDVertex){ + fSPDVertex->~AliESDVertex(); new (fSPDVertex) AliESDVertex(); fSPDVertex->SetName(fESDListName[kSPDVertex]); } if(fPrimaryVertex){ + fPrimaryVertex->~AliESDVertex(); new (fPrimaryVertex) AliESDVertex(); fPrimaryVertex->SetName(fESDListName[kPrimaryVertex]); } - if(fSPDMult)new (fSPDMult) AliMultiplicity(); + if(fSPDMult){ + fSPDMult->~AliMultiplicity(); + new (fSPDMult) AliMultiplicity(); + } if(fPHOSTrigger)fPHOSTrigger->Reset(); if(fEMCALTrigger)fEMCALTrigger->Reset(); if(fTracks)fTracks->Delete(); @@ -453,22 +458,21 @@ Int_t AliESDEvent::AddCaloCluster(const AliESDCaloCluster *c) { void AliESDEvent::SetVertex(const AliESDVertex *vertex) { // use already allocated space if(fSPDVertex){ - new(fSPDVertex) AliESDVertex(*vertex); + *fSPDVertex = *vertex; fSPDVertex->SetName(fESDListName[kSPDVertex]); } } void AliESDEvent::SetPrimaryVertex(const AliESDVertex *vertex) { - // use already allocated space if(fPrimaryVertex){ - new(fPrimaryVertex) AliESDVertex(*vertex); + *fPrimaryVertex = *vertex; fPrimaryVertex->SetName(fESDListName[kPrimaryVertex]); } } void AliESDEvent::SetMultiplicity(const AliMultiplicity *mul) { if(fSPDMult){ - new (fSPDMult) AliMultiplicity(*mul); + *fSPDMult = *mul; } } @@ -476,7 +480,7 @@ void AliESDEvent::SetMultiplicity(const AliMultiplicity *mul) { void AliESDEvent::SetFMDData(AliESDFMD * obj) { // use already allocated space if(fESDFMD){ - new(fESDFMD) AliESDFMD(*obj); + *fESDFMD = *obj; } } diff --git a/STEER/AliESDFMD.cxx b/STEER/AliESDFMD.cxx index 94392820e00..fed4be7bec6 100755 --- a/STEER/AliESDFMD.cxx +++ b/STEER/AliESDFMD.cxx @@ -63,8 +63,11 @@ AliESDFMD& AliESDFMD::operator=(const AliESDFMD& other) { // Default CTOR - fMultiplicity = other.fMultiplicity; - fEta = other.fEta; + if(this!=&other){ + TObject::operator=(other); + fMultiplicity = other.fMultiplicity; + fEta = other.fEta; + } return *this; } diff --git a/STEER/AliESDVertex.cxx b/STEER/AliESDVertex.cxx index 6a40928ab90..a2a320b598c 100644 --- a/STEER/AliESDVertex.cxx +++ b/STEER/AliESDVertex.cxx @@ -161,26 +161,16 @@ AliESDVertex &AliESDVertex::operator=(const AliESDVertex &source){ // // assignment operator // - if(&source == this) return *this; - this->SetName(source.GetName()); - this->SetTitle(source.GetTitle()); - for(Int_t i=0;i<3;i++) { - fPosition[i] = source.fPosition[i]; - fSNR[i] = source.fSNR[i]; - } - fCovXX = source.fCovXX; - fCovXY = source.fCovXY; - fCovYY = source.fCovYY; - fCovXZ = source.fCovXZ; - fCovYZ = source.fCovYZ; - fCovZZ = source.fCovZZ; - fChi2 = source.fChi2; - fSigma = source.GetDispersion(); - fNContributors = source.GetNContributors(); - fNIndices = source.GetNIndices(); - if(source.fNIndices>0) { - fIndices = new UShort_t[fNIndices]; - memcpy(fIndices,source.fIndices,fNIndices*sizeof(UShort_t)); + if(&source != this){ + AliVertex::operator=(source); + for(Int_t i=0;i<3;++i)fSNR[i] = source.fSNR[i]; + fCovXX = source.fCovXX; + fCovXY = source.fCovXY; + fCovYY = source.fCovYY; + fCovXZ = source.fCovXZ; + fCovYZ = source.fCovYZ; + fCovZZ = source.fCovZZ; + fChi2 = source.fChi2; } return *this; } diff --git a/STEER/AliKalmanTrack.cxx b/STEER/AliKalmanTrack.cxx index b3958e62ba4..c6548e6080b 100644 --- a/STEER/AliKalmanTrack.cxx +++ b/STEER/AliKalmanTrack.cxx @@ -43,7 +43,6 @@ ClassImp(AliKalmanTrack) for(Int_t i=0; i(file->Get("L3B02")); file->Close(); delete file; + delete fname; // see documentation to expand filenam fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB02.root"); file = new TFile(fname); fFieldMap[1] = dynamic_cast(file->Get("DipB02")); file->Close(); delete file;; - + delete fname; fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB02.root"); file = new TFile(fname); fFieldMap[2] = dynamic_cast(file->Get("ExtB02")); file->Close(); delete file; + delete fname; } else if (fMap == k4kG) { fSolenoid = 4.; fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B04.root"); @@ -134,16 +136,19 @@ void AliMagFMaps::ReadField() fFieldMap[0] = dynamic_cast(file->Get("L3B04")); file->Close(); delete file; + delete fname; fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB04.root"); file = new TFile(fname); fFieldMap[1] = dynamic_cast(file->Get("DipB04")); file->Close(); + delete fname; delete file; fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB04.root"); file = new TFile(fname); fFieldMap[2] = dynamic_cast(file->Get("ExtB04")); file->Close(); + delete fname; delete file; } else if (fMap == k5kG) { fSolenoid = 5.; @@ -151,18 +156,20 @@ void AliMagFMaps::ReadField() file = new TFile(fname); fFieldMap[0] = dynamic_cast(file->Get("L3B05")); file->Close(); - delete file; + delete file; + delete fname; fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB05.root"); file = new TFile(fname); fFieldMap[1] = dynamic_cast(file->Get("DipB05")); file->Close(); delete file; - + delete fname; fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB05.root"); file = new TFile(fname); fFieldMap[2] = dynamic_cast(file->Get("ExtB05")); file->Close(); delete file; + delete fname; } if (!fL3Option) fSolenoidUser = fSolenoid; diff --git a/STEER/AliMultiplicity.cxx b/STEER/AliMultiplicity.cxx index f8cdb3b14eb..a92ebaee78d 100644 --- a/STEER/AliMultiplicity.cxx +++ b/STEER/AliMultiplicity.cxx @@ -17,7 +17,6 @@ AliMultiplicity::AliMultiplicity(): { // Default Constructor - fFiredChips[0] = -1; fFiredChips[1] = -1; } @@ -55,7 +54,6 @@ AliMultiplicity::AliMultiplicity(Int_t ntr, Float_t *t, Float_t *ph, Float_t *d fPhisingle[i]=ps[i]; } } - fFiredChips[0] = -1; fFiredChips[1] = -1; } @@ -73,9 +71,7 @@ AliMultiplicity::AliMultiplicity(const AliMultiplicity& m): fPhisingle(0) { // copy constructor - Duplicate(m); - } //______________________________________________________________________ @@ -84,12 +80,12 @@ AliMultiplicity &AliMultiplicity::operator=(const AliMultiplicity& m){ if(this == &m)return *this; ((TObject *)this)->operator=(m); - if (fTh)delete [] fTh; - if(fPhi)delete [] fPhi; - if(fDeltPhi)delete [] fDeltPhi; - if(fLabels)delete [] fLabels; - if(fThsingle)delete [] fThsingle; - if(fPhisingle)delete [] fPhisingle; + if(fTh)delete [] fTh;fTh = 0; + if(fPhi)delete [] fPhi;fPhi = 0; + if(fDeltPhi)delete [] fDeltPhi;fDeltPhi = 0; + if(fLabels)delete [] fLabels;fLabels = 0; + if(fThsingle)delete [] fThsingle;fThsingle = 0; + if(fPhisingle)delete [] fPhisingle;fPhisingle = 0; Duplicate(m); return *this; @@ -100,9 +96,9 @@ void AliMultiplicity::Duplicate(const AliMultiplicity& m){ // used by copy constructor and assignment operator fNtracks = m.fNtracks; if(fNtracks>0){ - fTh = new Float_t [fNtracks]; - fPhi = new Float_t [fNtracks]; - fDeltPhi = new Float_t [fNtracks]; + fTh = new Float_t[fNtracks]; + fPhi = new Float_t[fNtracks]; + fDeltPhi = new Float_t[fNtracks]; fLabels = new Int_t[fNtracks]; } else { @@ -113,8 +109,8 @@ void AliMultiplicity::Duplicate(const AliMultiplicity& m){ } fNsingle = m.fNsingle; if(fNsingle>0){ - fThsingle = new Float_t [fNsingle]; - fPhisingle = new Float_t [fNsingle]; + fThsingle = new Float_t[fNsingle]; + fPhisingle = new Float_t[fNsingle]; } else { fThsingle = 0; @@ -134,12 +130,13 @@ void AliMultiplicity::Duplicate(const AliMultiplicity& m){ //______________________________________________________________________ AliMultiplicity::~AliMultiplicity(){ // Destructor - if (fTh)delete [] fTh; - if(fPhi)delete [] fPhi; - if(fDeltPhi)delete [] fDeltPhi; - if(fLabels)delete [] fLabels; - if(fThsingle)delete [] fThsingle; - if(fPhisingle)delete [] fPhisingle; + if(fTh)delete [] fTh;fTh = 0; + if(fPhi)delete [] fPhi;fPhi = 0; + if(fDeltPhi)delete [] fDeltPhi;fDeltPhi = 0; + if(fLabels)delete [] fLabels;fLabels = 0; + if(fThsingle)delete [] fThsingle;fThsingle = 0; + if(fPhisingle)delete [] fPhisingle;fPhisingle = 0; + } diff --git a/STEER/AliVertex.cxx b/STEER/AliVertex.cxx index 29946017398..593ff60ed91 100644 --- a/STEER/AliVertex.cxx +++ b/STEER/AliVertex.cxx @@ -81,17 +81,18 @@ AliVertex &AliVertex::operator=(const AliVertex &source){ // // assignment operator // - if(&source == this) return *this; - this->SetName(source.GetName()); - this->SetTitle(source.GetTitle()); - for(Int_t i=0;i<3;i++)fPosition[i] = source.fPosition[i]; - fSigma = source.GetDispersion(); - fNContributors = source.GetNContributors(); - fNIndices = source.GetNIndices(); - fIndices = 0x0; - if(source.fNIndices>0) { - fIndices = new UShort_t[fNIndices]; - memcpy(fIndices,source.fIndices,fNIndices*sizeof(UShort_t)); + if(&source != this){ + TNamed::operator=(source); + for(Int_t i=0;i<3;i++)fPosition[i] = source.fPosition[i]; + fSigma = source.GetDispersion(); + fNContributors = source.GetNContributors(); + fNIndices = source.GetNIndices(); + if(fIndices)delete [] fIndices; + fIndices = 0; + if(fNIndices>0) { + fIndices = new UShort_t[fNIndices]; + memcpy(fIndices,source.fIndices,fNIndices*sizeof(UShort_t)); + } } return *this; } @@ -103,6 +104,7 @@ AliVertex::~AliVertex() { // Default Destructor // delete [] fIndices; + fIndices = 0; } //-------------------------------------------------------------------------- void AliVertex::GetXYZ(Double_t position[3]) const { diff --git a/TPC/AliComplexCluster.cxx b/TPC/AliComplexCluster.cxx index c3e0e8ed5b1..7554a65f3ce 100644 --- a/TPC/AliComplexCluster.cxx +++ b/TPC/AliComplexCluster.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2006/11/06 16:07:15 kowal2 +Eff C++ + Revision 1.8 2004/03/30 14:09:22 kowal2 Changes due to the coding conventions @@ -102,6 +105,23 @@ Bool_t AliComplexCluster::IsSortable() const ClassImp(AliTPCExactPoint) ClassImp(AliTPCClusterPoint) ClassImp(AliTPCTrackerPoint) + +AliTPCTrackerPoint& AliTPCTrackerPoint::operator=(const AliTPCTrackerPoint& o){ + if(this!=&o){ + fTX = o.fTX; + fTY = o.fTY; + fTZ = o.fTZ; + fTAngleZ = o.fTAngleZ; + fTAngleY = o.fTAngleY; + fSigmaZ = o.fSigmaZ; + fSigmaY = o.fSigmaY; + fErrZ = o.fErrZ; + fErrY = o.fErrY; + fIsShared = o.fIsShared; + } + return *this; +} + ClassImp(AliTPCTrackPoint) ClassImp(AliTPCTrackPoint2) ClassImp(AliTPCTrackPointRef) diff --git a/TPC/AliComplexCluster.h b/TPC/AliComplexCluster.h index 28e9202208e..7b9d57a9e55 100644 --- a/TPC/AliComplexCluster.h +++ b/TPC/AliComplexCluster.h @@ -65,6 +65,7 @@ class AliTPCTrackerPoint { fErrY(0), fIsShared(0){} virtual ~AliTPCTrackerPoint(){} + AliTPCTrackerPoint &operator=(const AliTPCTrackerPoint& o); Float_t GetX() const {return (fTX*0.01);} Float_t GetZ() const {return (fTZ*0.01);} Float_t GetY() const {return (fTY*0.01);} @@ -102,7 +103,7 @@ class AliTPCTrackerPoint { UShort_t fErrY; // y error estimate - in mm - 50 mum precision Char_t fIsShared; // indicate sharing of the point between several tracks - ClassDef(AliTPCTrackerPoint,1) + ClassDef(AliTPCTrackerPoint,2) }; class AliTPCClusterPoint { diff --git a/TPC/AliTPCseed.cxx b/TPC/AliTPCseed.cxx index 77b7b39fa9a..8c2940dd133 100644 --- a/TPC/AliTPCseed.cxx +++ b/TPC/AliTPCseed.cxx @@ -239,12 +239,51 @@ AliTPCseed::~AliTPCseed(){ for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE; } //_________________________________________________ -AliTPCseed & AliTPCseed::operator =(const AliTPCseed & param) +AliTPCseed & AliTPCseed::operator=(const AliTPCseed ¶m) { // - // assignment operator - dummy + // assignment operator // - fRow=param.fRow; + if(this!=¶m){ + AliTPCtrack::operator=(param); + fEsd =param.fEsd; + for(Int_t i = 0;i<160;++i)fClusterPointer[i] = param.fClusterPointer[i]; // this is not allocated by AliTPCSeed + fClusterOwner = param.fClusterOwner; + // leave out fPoint, they are also not copied in the copy ctor... + // but deleted in the dtor... strange... + // fPoints = + // fEPoints = + fRow = param.fRow; + fSector = param.fSector; + fRelativeSector = param.fRelativeSector; + fCurrentSigmaY2 = param.fCurrentSigmaY2; + fCurrentSigmaZ2 = param.fCurrentSigmaZ2; + fErrorY2 = param.fErrorY2; + fErrorZ2 = param.fErrorZ2; + fCurrentCluster = param.fCurrentCluster; // this is not allocated by AliTPCSeed + fCurrentClusterIndex1 = param.fCurrentClusterIndex1; + fInDead = param.fInDead; + fIsSeeding = param.fIsSeeding; + fNoCluster = param.fNoCluster; + fSort = param.fSort; + fBSigned = param.fBSigned; + for(Int_t i = 0;i<4;++i){ + fDEDX[i] = param.fDEDX[i]; + fSDEDX[i] = param.fSDEDX[i]; + fNCDEDX[i] = param.fNCDEDX[i]; + } + for(Int_t i = 0;iGetAlpha(), shift=fSectors->GetAlphaShift(); Double_t cs=cos(alpha), sn=sin(alpha); // @@ -3119,6 +3119,7 @@ void AliTPCtrackerMI::MakeSeeds3(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, // if (!BuildSeed(kr1[is],kcl,0,x1,x2,x3,x,c)) continue; UInt_t index=kr1.GetIndex(is); + seed->~AliTPCseed(); // this does not set the pointer to 0... AliTPCseed *track=new(seed) AliTPCseed(x1, ns*alpha+shift, x, c, index); track->SetIsSeeding(kTRUE); @@ -3184,7 +3185,7 @@ void AliTPCtrackerMI::MakeSeeds3(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, } } } - + track->SetSeedType(0); arr->AddLast(track); seed = new AliTPCseed; @@ -3407,6 +3408,7 @@ void AliTPCtrackerMI::MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, // if (!BuildSeed(kr1[is],kcl,0,x1,x2,x3,x,c)) continue; UInt_t index=kr1.GetIndex(is); + seed->~AliTPCseed(); AliTPCseed *track=new(seed) AliTPCseed(x1, sec*alpha+shift, x, c, index); track->SetIsSeeding(kTRUE); @@ -3686,7 +3688,8 @@ void AliTPCtrackerMI::MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, UInt_t index=0; //kr0.GetIndex(is); - AliTPCseed *track=new (seed) AliTPCseed(x1,sec*alpha+shift,x,c,index); + seed->~AliTPCseed(); + AliTPCseed *track=new(seed) AliTPCseed(x1,sec*alpha+shift,x,c,index); track->SetIsSeeding(kTRUE); Int_t rc=FollowProlongation(*track, i2); if (constrain) track->SetBConstrain(1); @@ -4421,7 +4424,7 @@ void AliTPCtrackerMI::FindKinks(TObjArray * array, AliESDEvent *esd) if (TMath::Abs(ktrack0->GetC())>5) continue; // cut on the curvature for mother particle AliExternalTrackParam paramm(*ktrack0); AliExternalTrackParam paramd(*ktrack1); - if (row0>60&&ktrack1->GetReference().GetX()>90.) new (¶md) AliExternalTrackParam(ktrack1->GetReference()); + if (row0>60&&ktrack1->GetReference().GetX()>90.)new (¶md) AliExternalTrackParam(ktrack1->GetReference()); // // kink->SetMother(paramm); @@ -4562,8 +4565,8 @@ void AliTPCtrackerMI::FindKinks(TObjArray * array, AliESDEvent *esd) if (RefitKink(*seed0,*seed1,*kink)) kink->SetStatus(1,9); row0 = GetRowNumber(kink->GetR()); sumn = seed0->GetNumberOfClusters()+seed1->GetNumberOfClusters(); - new (&mothers[i]) AliTPCseed(*seed0); - new (&daughters[i]) AliTPCseed(*seed1); + mothers[i] = *seed0; + daughters[i] = *seed1; } else{ delete kinks->RemoveAt(i); @@ -4678,8 +4681,8 @@ void AliTPCtrackerMI::FindKinks(TObjArray * array, AliESDEvent *esd) // if ( ktrack0->GetKinkIndex(0)==0 && ktrack1->GetKinkIndex(0)==0) { //best kink if (mothers[indexes[i]].GetNumberOfClusters()>20 && daughters[indexes[i]].GetNumberOfClusters()>20 && (mothers[indexes[i]].GetNumberOfClusters()+daughters[indexes[i]].GetNumberOfClusters())>100){ - new (ktrack0) AliTPCseed(mothers[indexes[i]]); - new (ktrack1) AliTPCseed(daughters[indexes[i]]); + *ktrack0 = mothers[indexes[i]]; + *ktrack1 = daughters[indexes[i]]; } } // @@ -5198,8 +5201,8 @@ Int_t AliTPCtrackerMI::RefitKink(AliTPCseed &mother, AliTPCseed &daughter, AliES for (Int_t irow=0;irowResetCovariance(10.); FollowProlongation(*seed0,0); FollowBackProlongation(*seed1,158); - new (&mother) AliTPCseed(*seed0); // backup mother at position 0 + mother = *seed0; // backup mother at position 0 seed0->Reset(kFALSE); seed1->Reset(kFALSE); seed0->ResetCovariance(10.); @@ -5403,8 +5406,8 @@ Int_t AliTPCtrackerMI::CheckKinkPoint(AliTPCseed*seed,AliTPCseed &mother, AliTP for (Int_t irow=0;irow<20;irow++){ FollowBackProlongation(*seed0, rows[irow]); FollowProlongation(*seed1,rows[19-irow]); - new(¶m0[irow]) AliTPCseed(*seed0); - new(¶m1[19-irow]) AliTPCseed(*seed1); + param0[irow] = *seed0; + param1[19-irow] = *seed1; } // // define kinks @@ -5452,11 +5455,11 @@ Int_t AliTPCtrackerMI::CheckKinkPoint(AliTPCseed*seed,AliTPCseed &mother, AliTP // // // new (&mother) AliTPCseed(param0[index]); - new (&daughter) AliTPCseed(param1[index]); + daughter = param1[index]; daughter.SetLabel(kink.GetLabel(1)); param0[index].Reset(kTRUE); FollowProlongation(param0[index],0); - new (&mother) AliTPCseed(param0[index]); + mother = param0[index]; mother.SetLabel(kink.GetLabel(0)); delete seed0; delete seed1; @@ -6295,7 +6298,12 @@ void AliTPCtrackerMI::CookLabel(AliKalmanTrack *tk, Float_t wrong) const { //-------------------------------------------------------------------- //This function "cooks" a track label. If label<0, this track is fake. //-------------------------------------------------------------------- - AliTPCseed * t = (AliTPCseed*)tk; + AliTPCseed * t = dynamic_cast(tk); + if(!t){ + printf("%s:%d wrong type \n",(char*)__FILE__,__LINE__); + return; + } + Int_t noc=t->GetNumberOfClusters(); if (noc<10){ //printf("\nnot founded prolongation\n\n\n"); @@ -6504,6 +6512,7 @@ void AliTPCtrackerMI::AliTPCSector::Setup(const AliTPCParam *par, Int_t f) { fPadPitchWidth=par->GetInnerPadPitchWidth(); fPadPitchLength=par->GetInnerPadPitchLength(); fN=par->GetNRowLow(); + if(fRow)delete [] fRow;fRow = 0; fRow=new AliTPCRow[fN]; for (Int_t i=0; iGetPadRowRadiiLow(i)); @@ -6516,8 +6525,8 @@ void AliTPCtrackerMI::AliTPCSector::Setup(const AliTPCParam *par, Int_t f) { fPadPitchLength = par->GetOuter1PadPitchLength(); f1PadPitchLength = par->GetOuter1PadPitchLength(); f2PadPitchLength = par->GetOuter2PadPitchLength(); - fN=par->GetNRowUp(); + if(fRow)delete [] fRow;fRow = 0; fRow=new AliTPCRow[fN]; for (Int_t i=0; iGetPadRowRadiiUp(i)); -- 2.39.3