Added a protection in the dtor. When the tasks is created by default ctor (to access...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDigitizer.cxx
index cc985f3..4335046 100644 (file)
@@ -118,24 +118,26 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
   AliPHOSDigitizer::~AliPHOSDigitizer()
 {
   // dtor
-
+  // gime=0 if Digitizer created by default ctor (to get just the parameters)
+  
  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-
- // remove the task from the folder list
- gime->RemoveTask("S",GetName()) ;
- gime->RemoveTask("D",GetName()) ;
-
- // remove the Digits from the folder list
- gime->RemoveObjects("D", GetName()) ;
-
- // remove the SDigits from the folder list
- gime->RemoveSDigits() ;
-
- // Delete gAlice
- gime->CloseFile() ; 
-
- fSplitFile = 0 ; 
+ if (gime) {
+   // remove the task from the folder list
+   gime->RemoveTask("S",GetName()) ;
+   gime->RemoveTask("D",GetName()) ;
+   
+   // remove the Digits from the folder list
+   gime->RemoveObjects("D", GetName()) ;
+   
+   // remove the SDigits from the folder list
+   gime->RemoveSDigits() ;
+   
+   // Delete gAlice
+   gime->CloseFile() ; 
+   
+   fSplitFile = 0 ; 
+ }
 }
 
 //____________________________________________________________________________