]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Delete only existent objects.
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Jun 2000 10:13:14 +0000 (10:13 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Jun 2000 10:13:14 +0000 (10:13 +0000)
STEER/AliRun.cxx

index 0846e346d69e31bb4611c08a09710b13403eeb4e..3fe32ef4d133ed1980bd43aa9999406c1241613e 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.34  2000/05/18 10:45:38  fca
+Delete Particle Factory properly
+
 Revision 1.33  2000/05/16 13:10:40  fca
 New method IsNewTrack and fix for a problem in Father-Daughter relations
 
@@ -530,11 +533,21 @@ void AliRun::FinishRun()
   fTreeE->Write();
   
   // Clean tree information
-  delete fTreeK; fTreeK = 0;
-  delete fTreeH; fTreeH = 0;
-  delete fTreeD; fTreeD = 0;
-  delete fTreeR; fTreeR = 0;
-  delete fTreeE; fTreeE = 0;
+  if (fTreeK) {
+    delete fTreeK; fTreeK = 0;
+  }
+  if (fTreeH) {
+    delete fTreeH; fTreeH = 0;
+  }
+  if (fTreeD) {
+    delete fTreeD; fTreeD = 0;
+  }
+  if (fTreeR) {
+    delete fTreeR; fTreeR = 0;
+  }
+  if (fTreeE) {
+    delete fTreeE; fTreeE = 0;
+  }
   
   // Write AliRun info and all detectors parameters
   Write();
@@ -1418,7 +1431,7 @@ void AliRun::SetCurrentTrack(Int_t track)
 //_____________________________________________________________________________
 void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom,
                      Float_t *vpos, Float_t *polar, Float_t tof,
-                     const char *mecha, Int_t &ntr, Float_t weight)
+                     const char *mecha, Int_t &ntr, Float_t weight=1)
 { 
   //
   // Load a track on the stack