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 d1b0720..5819b86 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 20e99d1..f3224d6 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 a1e862e..c9e9684 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 3132c17..c18fa8d 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;
+  }
 }
 
 //______________________________________________________________________________