From: hristov Date: Tue, 2 Aug 2011 13:03:20 +0000 (+0000) Subject: Fix for #68917: Improper usage of TClonesArrays in ITS -- 2 X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=d5855dc9f3d2a631f27a3fc30fb2de049104a524;p=u%2Fmrichter%2FAliRoot.git Fix for #68917: Improper usage of TClonesArrays in ITS -- 2 --- diff --git a/ITS/AliITSRecPointContainer.cxx b/ITS/AliITSRecPointContainer.cxx index e2180111b60..333a7759f28 100644 --- a/ITS/AliITSRecPointContainer.cxx +++ b/ITS/AliITSRecPointContainer.cxx @@ -244,6 +244,15 @@ AliITSRecPointContainer* AliITSRecPointContainer::Instance(const AliITSRecoParam return fgInstance; } +//______________________________________________________________________ +void AliITSRecPointContainer::Destroy(){ + // deletes the singleton + if(fgInstance){ + delete fgInstance; + fgInstance = NULL; + } +} + //______________________________________________________________________ void AliITSRecPointContainer::Reset(){ // Resets the status of the object diff --git a/ITS/AliITSRecPointContainer.h b/ITS/AliITSRecPointContainer.h index c80bbfe06ce..c83289cefe8 100644 --- a/ITS/AliITSRecPointContainer.h +++ b/ITS/AliITSRecPointContainer.h @@ -28,6 +28,7 @@ class AliITSRecPointContainer : public TObject { Int_t GetNumberOfModules() const {return fActualSize; } static AliITSRecPointContainer* Instance(const AliITSRecoParam *ptr=NULL); + static void Destroy(); void PrepareToRead(){if(fNextEvent<0){fNextEvent=0;} else {++fNextEvent;}} TClonesArray* FetchClusters(Int_t mod, TTree* tR); TClonesArray* FetchClusters(Int_t mod, TTree* tR,Int_t cureve); diff --git a/ITS/AliITSReconstructor.h b/ITS/AliITSReconstructor.h index 7fe058591fd..38c8e021115 100644 --- a/ITS/AliITSReconstructor.h +++ b/ITS/AliITSReconstructor.h @@ -13,6 +13,7 @@ #include "AliReconstructor.h" #include "AliITSRecoParam.h" #include "AliITSDetTypeRec.h" +#include "AliITSRecPointContainer.h" class AliESDpid; class AliITSgeom; class AliTracker; @@ -38,6 +39,7 @@ public: virtual void FillESD(AliRawReader* /*rawReader*/, TTree* clustersTree, AliESDEvent* esd) const {FillESD((TTree*)NULL, clustersTree, esd);} + virtual void Terminate() const {AliITSRecPointContainer::Destroy();} void ResetRecPoints() {fDetTypeRec->ResetRecPoints();} static const AliITSRecoParam* GetRecoParam() { return dynamic_cast(AliReconstructor::GetRecoParam(0)); } diff --git a/STEER/STEER/AliReconstructor.h b/STEER/STEER/AliReconstructor.h index 4c63b21efa6..b3f12f3189b 100644 --- a/STEER/STEER/AliReconstructor.h +++ b/STEER/STEER/AliReconstructor.h @@ -70,6 +70,7 @@ public: virtual void FillEventTimeWithTOF(AliESDEvent *, AliESDpid *) {return;} + virtual void Terminate() const {return; } private: