From: cholm Date: Wed, 3 Dec 2014 11:15:39 +0000 (+0100) Subject: Handle deletion of AliFMDAltroMapping object. If we make the object X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=26fc9d1e130dccb4f51861a3094e27cb7a60a738 Handle deletion of AliFMDAltroMapping object. If we make the object ourselves, make sure to set the bit TObject::kCanDelete. If the object comes from OCDB, make sure to clear that bit. Only delete the object if TObject::kCanDelete is set. Note, AliFMDAltroMapping is a static object. None of it members ever various based on run number or the like. It reflects the static nature of the hardware mapping of the FMD. --- diff --git a/FMD/AliFMDParameters.cxx b/FMD/AliFMDParameters.cxx index b5673afa8fd..1c12fbdf400 100644 --- a/FMD/AliFMDParameters.cxx +++ b/FMD/AliFMDParameters.cxx @@ -126,6 +126,7 @@ AliFMDParameters::AliFMDParameters() SetStripRange(); SetGain(); fAltroMap = new AliFMDAltroMapping; + fAltroMap->SetBit(TObject::kCanDelete); } //__________________________________________________________________ @@ -841,7 +842,7 @@ AliFMDParameters::InitAltroMap(AliFMDPreprocessor* pp) // Parameters: // pp Pre-processor if called from shuttle // - if (fAltroMap) { + if (fAltroMap && fAltroMap->TestBit(TObject::kCanDelete)) { delete fAltroMap; fAltroMap = 0; } @@ -849,10 +850,12 @@ AliFMDParameters::InitAltroMap(AliFMDPreprocessor* pp) if (hwMap) { AliFMDDebug(5, ("Got ALTRO map from CDB")); fAltroMap = dynamic_cast(hwMap->GetObject()); + if (fAltroMap) fAltroMap->ResetBit(TObject::kCanDelete); } if (!fAltroMap) { AliError("Invalid ALTRO map object from CDB"); fAltroMap = new AliFMDAltroMapping; + fAltroMap->SetBit(TObject::kCanDelete); // return kAltroMap; } return 0;