]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONCalibrationData.cxx
Updated geometry
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.cxx
index 1b68de364f6a26476bc2552b30c4cfaaa88bc101..8749b9b910f5e9a2d728bf18951c1bf04f0cfc01 100644 (file)
@@ -97,7 +97,8 @@ fNeighbours(0x0)
 AliMUONCalibrationData::~AliMUONCalibrationData()
 {
   /// Destructor. Note that we're the owner of our pointers.
-  Reset();
+  //PH The owner of the objects is CDB, do not delete them!
+  //  Reset();
 }
 
 //_____________________________________________________________________________
@@ -177,28 +178,15 @@ AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* s
   
   AliCDBManager* man = AliCDBManager::Instance();
   
-  if ( !man->IsDefaultStorageSet() )
-  {
-    AliErrorClass("CDB Storage not set. Must use AliCDBManager::Instance()->SetDefaultStorage() first.");
-    return 0x0;
-  }
-  
-  Bool_t cacheStatus = man->GetCacheFlag();
+  AliCDBEntry* entry =  man->Get(path,runNumber);
   
-  man->SetCacheFlag(kFALSE);
-  
-  AliCDBEntry* entry =  AliCDBManager::Instance()->Get(path,runNumber);
-  
-  man->SetCacheFlag(cacheStatus);
-
-       
   if (entry)
   {
                if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
                
     TObject* object = entry->GetObject();
     entry->SetOwner(kFALSE);
-    delete entry;
+    if (!(man->GetCacheFlag())) delete entry;
     return object;
   }
        else