Corrected destructors taking into account the ownership of the data
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Mar 2004 12:03:33 +0000 (12:03 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Mar 2004 12:03:33 +0000 (12:03 +0000)
MUON/AliMUONClusterFinderVS.cxx
MUON/AliMUONClusterReconstructor.cxx
MUON/AliMUONTriggerDecision.cxx
MUON/AliMUONVGeometryBuilder.cxx

index d1b07208f89ccd743d5fe9f39ee485725e1f49d8..5819b861e62d62a149d3bf5a55c2c018e52809d2 100644 (file)
@@ -72,7 +72,10 @@ AliMUONClusterFinderVS::~AliMUONClusterFinderVS()
 {
   // Reset tracks information
    fNRawClusters = 0;
-   if (fRawClusters) fRawClusters->Delete();
+   if (fRawClusters) {
+     fRawClusters->Delete();
+     delete fRawClusters;
+   }
 }
 
 AliMUONClusterFinderVS::AliMUONClusterFinderVS(const AliMUONClusterFinderVS & clusterFinder):TObject(clusterFinder)
index 20e99d1db7e4160f2413b7b311ce4bb542a354db..f3224d6e205b8830baac6e7f445781c0cce5f4ba 100644 (file)
@@ -113,7 +113,7 @@ AliMUONClusterReconstructor & AliMUONClusterReconstructor::operator=(const AliMU
 AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
 {
   if (fChambers){
-    fChambers->Delete();
+    fChambers->Clear(); // Sets pointers to 0 sinche it is not the owner
     delete fChambers;
   } 
   if (fMUONData)
index a1e862e57df529afd3f4a962b1ee9a7e76c046cf..c9e96849cfcaf9f9d6f91caa0cab8a8d78219ed0 100644 (file)
@@ -122,7 +122,7 @@ AliMUONTriggerDecision::~AliMUONTriggerDecision()
 {
 // Destructor
   if (fTriggerCircuit){
-    fTriggerCircuit->Delete();
+    fTriggerCircuit->Clear();// Sets pointers to 0 sinche it is not the owner
     delete fTriggerCircuit;
   } 
   if (fMUONData)
index 3132c17e0b251f22d698cc0dc683d965c29e0c92..c18fa8d2338595b8da521b2a3cd5ed17ca3e45ef 100644 (file)
@@ -56,8 +56,10 @@ AliMUONVGeometryBuilder::AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder&
 //______________________________________________________________________________
 AliMUONVGeometryBuilder::~AliMUONVGeometryBuilder() {
 //
-
-  delete fChambers;
+  if (fChambers) {
+    fChambers->Clear(); // Sets pointers to 0 sinche it is not the owner
+    delete fChambers;
+  }
 }
 
 //______________________________________________________________________________