Removing memory leak
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 27 Jun 2005 07:34:52 +0000 (07:34 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 27 Jun 2005 07:34:52 +0000 (07:34 +0000)
FMD/AliFMDReconstructor.cxx

index 2c614666cb5dac53eca53f2d6a3f17743451e123..88949f26b58e8cda02c4b09fcf2a26992d383355 100644 (file)
@@ -235,11 +235,11 @@ AliFMDReconstructor::Reconstruct(TTree* digitsTree,
   AliDebug(1, "Reconstructing from digits in a tree");
   
   TBranch *digitBranch = digitsTree->GetBranch("FMD");
-  TClonesArray* digits = new TClonesArray("AliFMDDigit");
   if (!digitBranch) {
     Error("Exec", "No digit branch for the FMD found");
     return;
   }
+  TClonesArray* digits = new TClonesArray("AliFMDDigit");
   digitBranch->SetAddress(&digits);
 
   TIter next(&fAlgorithms);
@@ -255,6 +255,8 @@ AliFMDReconstructor::Reconstruct(TTree* digitsTree,
   while ((algorithm = static_cast<AliFMDMultAlgorithm*>(next()))) 
     algorithm->PostEvent();
   clusterTree->Fill();
+  digits->Delete();
+  delete digits;
 }
  
 //____________________________________________________________________