Safer distructor - some checks added.
[u/mrichter/AliRoot.git] / 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;
+  }
 }
 
 //______________________________________________________________________________
 }
 
 //______________________________________________________________________________