Safer distructor - some checks added.
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Oct 2007 07:23:53 +0000 (07:23 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Oct 2007 07:23:53 +0000 (07:23 +0000)
TOF/AliTOFPreprocessor.cxx

index a6f80d737dee9f1002894ea6e53de6d1591b9dc1..13992f70d178aed2d8d8241c8c6befaa157513de 100644 (file)
@@ -72,13 +72,19 @@ AliTOFPreprocessor::AliTOFPreprocessor(AliShuttleInterface* shuttle) :
 AliTOFPreprocessor::~AliTOFPreprocessor()
 {
   // destructor
 AliTOFPreprocessor::~AliTOFPreprocessor()
 {
   // destructor
-  delete fData;
-  fData = 0;
-  delete fh2;
-  fh2 = 0;
-  fCal->Clear();
-  delete fCal;
-  fCal = 0;
+  if (fData){
+    delete fData;
+    fData = 0;
+  }
+  if (fh2){
+    delete fh2;
+    fh2 = 0;
+  }
+  if (fCal){
+    fCal->Clear();
+    delete fCal;
+    fCal = 0;
+  }
 }
 
 //______________________________________________________________________________
 }
 
 //______________________________________________________________________________