Fixing memory leaks
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Feb 2004 18:25:01 +0000 (18:25 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Feb 2004 18:25:01 +0000 (18:25 +0000)
TOF/AliTOFDigitizer.cxx
TOF/AliTOFHitMap.cxx

index 3da3d0b3ca6b78e0726539466ea10fcacfad5f55..5ca7564d5a588a428c0d8aaa07d9b9924e4a743c 100644 (file)
@@ -143,6 +143,8 @@ void AliTOFDigitizer::Exec(Option_t* option)
   // free used memory for Hit Map in current event
   delete fhitMap;
   fSDigitsArray->Delete();
+  delete fSDigitsArray;
+
   treeD->Fill();
  
   outgime->WriteDigits("OVERWRITE");
@@ -322,11 +324,11 @@ void AliTOFDigitizer::ReadSDigit(Int_t inputFile )
       } // if (hitMap->TestHit(vol) != kEmpty)
       
     } // for (Int_t k=0; k<ndig; k++)
+    sdigitsDummyContainer->Delete();
 
   } // end loop on entries
 
-  sdigitsDummyContainer->Delete();
-  sdigitsDummyContainer=0;
+  delete sdigitsDummyContainer;
 
 }
 
index 3e93c2ec74467d17170df0e910582bd0dd4ca191..f657814ec5b5adb253f8714931325e0f1e9937e9 100644 (file)
@@ -92,7 +92,7 @@ AliTOFHitMap::~AliTOFHitMap()
 //
 // Destructor
 //
-    if (fHitMap) delete[] fHitMap;
+    delete[] fHitMap;
 }
 
 ////////////////////////////////////////////////////////////////////////