Corrections in the destructors
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Apr 2003 13:36:59 +0000 (13:36 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Apr 2003 13:36:59 +0000 (13:36 +0000)
ITS/AliITS.cxx
ITS/AliITSmodule.cxx

index 04368ce..334c77f 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.76  2002/11/21 23:05:27  alibrary
+Removing AliMC and AliMCProcess
+
 Revision 1.75  2002/10/22 14:45:25  alibrary
 Introducing Riostream.h
 
@@ -455,36 +458,49 @@ AliITS::~AliITS(){
     // Return:
     //      none.
 
-    delete fHits; fHits=0;
-    delete fSDigits; fSDigits=0;
+  if (fHits) {
+    fHits->Delete();
+    delete fHits;
+    fHits=0;
+  }
+  if (fSDigits) {
+    fSDigits->Delete();
+    delete fSDigits;
+    fSDigits=0;
+  }
 //    delete fDigits; fDigits=0;
-    delete fRecPoints; fRecPoints=0;
-    if(fIdName!=0) delete[] fIdName;  // Array of TStrings
-    if(fIdSens!=0) delete[] fIdSens;
-    if(fITSmodules!=0) {
+  if (fRecPoints) {
+    fRecPoints->Delete();
+    delete fRecPoints;
+    fRecPoints=0;
+  }
+  delete[] fIdName;  // Array of TStrings
+  delete[] fIdSens;
+  if(fITSmodules) {
        this->ClearModules();
        delete fITSmodules;
-    }// end if fITSmodules!=0
-
-    if(fDtype) {
-       fDtype->Delete();
-       delete fDtype;
-    } // end if fDtype
-    delete [] fNdtype;
-    if (fCtype) {
-       fCtype->Delete();
-       delete fCtype;
-    } // end if fCtype
-    delete [] fNctype;
-
-    if (fDetTypes) {
-       fDetTypes->Delete();
-       delete fDetTypes;
-    } // end if fDetTypes
-
-    if (fTreeC) delete fTreeC;
-
-    if (fITSgeom) delete fITSgeom;
+       fITSmodules = 0;
+  }// end if fITSmodules!=0
+
+  if(fDtype) {
+    fDtype->Delete();
+    delete fDtype;
+  } // end if fDtype
+  delete [] fNdtype;
+  if (fCtype) {
+    fCtype->Delete();
+    delete fCtype;
+  } // end if fCtype
+  delete [] fNctype;
+
+  if (fDetTypes) {
+    fDetTypes->Delete();
+    delete fDetTypes;
+  } // end if fDetTypes
+
+  if (fTreeC) delete fTreeC;
+
+  if (fITSgeom) delete fITSgeom;
 }
 //______________________________________________________________________
 AliITS::AliITS(AliITS &source){
index 9d0c40a..d18710d 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.15  2003/03/21 13:58:14  masera
+Fix to avoid out-of-detector fast rec points (problem occurring for tracks entering and exiting the same side of a sensitive volume)
+
 Revision 1.14  2002/10/14 14:57:00  hristov
 Merging the VirtualMC branch to the main development branch (HEAD)
 
@@ -126,10 +129,9 @@ AliITSmodule::~AliITSmodule() {
     // we must first destroy all of it's members.
 
     if(fHitsM){
-       for(Int_t i=0;i<fHitsM->GetEntriesFast();i++) 
-           delete ((AliITShit *)(fHitsM->At(i)));
-       // must delete each object in the TObjArray.
-       delete fHitsM;
+      fHitsM->Delete();
+      delete fHitsM;
+      fHitsM = 0;
     } // end if
     delete fTrackIndex;
     delete fHitIndex;