]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Additional protection in the destructor: when you have a chain of calls returning...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 10:49:35 +0000 (10:49 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 10:49:35 +0000 (10:49 +0000)
ITS/AliITSDetTypeRec.cxx

index b2016d68cc8f05ef4fb5fc503b6d085882fc39aa..e217bdbd921e0cdba583224240eced39a923240e 100644 (file)
@@ -173,10 +173,17 @@ AliITSDetTypeRec::~AliITSDetTypeRec(){
   }
   if(fCalibration){
     if(!(AliCDBManager::Instance()->GetCacheFlag())) {
-      AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()))->GetResponse();    
-      AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD()))->GetResponse();
-      if(rspd) delete rspd;
-      if(rssd) delete rssd;
+      AliITSCalibration * calSPD = (AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()); 
+      if (calSPD) {
+       AliITSresponse* rspd = calSPD->GetResponse();    
+       if(rspd) delete rspd;
+      }
+
+      AliITSCalibration * calSSD = (AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD());
+      if (calSSD) {
+       AliITSresponse* rssd = calSSD->GetResponse();
+       if(rssd) delete rssd;
+      }
       fCalibration->Delete();
       delete fCalibration;
       fCalibration = 0;