]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixes for memory leaks (Christian)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Aug 2007 12:56:55 +0000 (12:56 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Aug 2007 12:56:55 +0000 (12:56 +0000)
EMCAL/AliEMCALReconstructor.cxx
EMCAL/AliEMCALTracker.cxx
HMPID/AliHMPIDReconstructor.h
MUON/AliMUONTrackReconstructorK.cxx
STEER/AliESDCaloTrigger.h

index ec86dc37effe82546f92a454664b34faa249d4f3..c11165c323cf8a992d35d74a448e9bdb41387577 100644 (file)
@@ -289,7 +289,7 @@ void AliEMCALReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) c
       for (Int_t ipr=0; ipr<parentMult; ipr++) 
        parentList[ipr] = (Short_t)(parentInts[ipr]);    
       
-      
+    
       // fills the ESDCaloCluster
       AliESDCaloCluster * ec = new AliESDCaloCluster() ; 
       ec->SetEMCAL(kTRUE);
@@ -322,13 +322,18 @@ void AliEMCALReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) c
       // add the cluster to the esd object
       esd->AddCaloCluster(ec);
       delete ec;
-      
+      delete [] parentList;
     } else { // no new ESD cluster
-      delete [] amplList;
-      delete [] timeList;
-      delete [] digiList;
+      
     }
+    delete [] amplList;
+    delete [] timeList;
+    delete [] digiList;
+
   } // cycle on clusters
+
+  delete [] matchedTrack;
+
   esd->SetNumberOfEMCALClusters(nClustersNew);
   //if(nClustersNew != nClusters) 
   //printf(" ##### nClusters %i -> new %i ##### \n", nClusters, nClustersNew );
index bbea85873633f214ba11acc635416e8e4bb31e93..cc2f2fef45eae0b681215dd9c698633422097a59 100644 (file)
@@ -999,6 +999,9 @@ Int_t AliEMCALTracker::SolveCompetitions()
        }
        */
        
+       delete [] usedC;
+       delete [] usedT;
+
        return count;
 }
 //
index b8a6bdc520213175571b2e434211476408dfcb9c..fda3c8dcc3ba46cda08fe1f47fb28626134cc5d6 100644 (file)
@@ -18,7 +18,7 @@ class AliHMPIDReconstructor: public AliReconstructor
 {
 public:
            AliHMPIDReconstructor();              
-  virtual ~AliHMPIDReconstructor()                                  {delete fDig;delete fClu;}//dtor  
+  virtual ~AliHMPIDReconstructor()                                  {delete fDig;delete fClu;delete [] fUserCut;}//dtor  
 //framework part  
   AliTracker*  CreateTracker         (AliRunLoader*                      )const{return new AliHMPIDTracker;}            //from AliReconstructor for clusters->PID
   void         ConvertDigits         (AliRawReader *pRR, TTree *pDigTree) const;                                        //from AliReconstruction for raw->digit
index 08e452b29dafbceea5814fe45c26d6ae0aeda8bb..7eefa406c8c5f2daa76ee6b83e90da6eca986999 100644 (file)
@@ -353,7 +353,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
   AliMUONTrackParam bestTrackParamAtHit2;
   Bool_t *hitForRecCh1Used = new Bool_t[fNHitsForRecPerChamber[ch1]];
   for (Int_t hit1 = 0; hit1 < fNHitsForRecPerChamber[ch1]; hit1++) hitForRecCh1Used[hit1] = kFALSE;
-  
+
   // Get track parameters
   AliMUONTrackParam extrapTrackParamAtCh(*(AliMUONTrackParam*)trackCandidate.GetTrackParamAtHit()->First());
   
@@ -630,16 +630,21 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
         if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
       }
       
-    } else return kFALSE;
-    
+    } else {
+      delete [] hitForRecCh1Used;
+      return kFALSE;
+    }
   } else if (foundOneHit || foundTwoHits) {
     
     // remove obsolete track
     fRecTracksPtr->Remove(&trackCandidate);
     fNRecTracks--;
     
-  } else return kFALSE;
-  
+  } else {
+    delete [] hitForRecCh1Used;
+    return kFALSE;
+  }  
+  delete [] hitForRecCh1Used;
   return kTRUE;
   
 }
index 3e05f21b1a4532f5db97b259509c4cd340c1d740..577512f20c763955d4a3bd652ad9cc607a424226 100644 (file)
@@ -30,8 +30,15 @@ public:
   virtual ~AliESDCaloTrigger();
 
   // does this create mem leak? CKB use new with placement?
-  void AddTriggerPosition(const TArrayF & array)  { fTriggerPosition     = new TArrayF(array); }
-  void AddTriggerAmplitudes(const TArrayF & array) { fTriggerAmplitudes  = new TArrayF(array); }
+  void AddTriggerPosition(const TArrayF & array)  { 
+    if(fTriggerPosition) delete fTriggerPosition;
+    fTriggerPosition =  new TArrayF(array);
+  }
+
+  void AddTriggerAmplitudes(const TArrayF & array) { 
+    if(fTriggerAmplitudes)delete fTriggerAmplitudes;
+    fTriggerAmplitudes  = new TArrayF(array); 
+  }
   
   void Reset();