From: cblume Date: Tue, 3 Aug 2010 11:18:00 +0000 (+0000) Subject: Introduce proper destructor X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=99586a9d52c658644c527c0abf8b799b831b8dbb;p=u%2Fmrichter%2FAliRoot.git Introduce proper destructor --- diff --git a/TRD/Cal/AliTRDCalDCSGTU.cxx b/TRD/Cal/AliTRDCalDCSGTU.cxx index 5e0ecb540ef..d0e96cfa1e3 100644 --- a/TRD/Cal/AliTRDCalDCSGTU.cxx +++ b/TRD/Cal/AliTRDCalDCSGTU.cxx @@ -73,6 +73,26 @@ AliTRDCalDCSGTU::AliTRDCalDCSGTU(const AliTRDCalDCSGTU&) // } +//_____________________________________________________________________________ +AliTRDCalDCSGTU::~AliTRDCalDCSGTU() +{ + // + // AliTRDCalDCSGTU destructor + // + + if (fSegmentsArr) { + fSegmentsArr->Delete(); + delete fSegmentsArr; + fSegmentsArr = 0x0; + } + + if (fTgu) { + delete fTgu; + fTgu = 0x0; + } + +} + //_____________________________________________________________________________ AliTRDCalDCSGTU& AliTRDCalDCSGTU::operator=(const AliTRDCalDCSGTU& sh) { diff --git a/TRD/Cal/AliTRDCalDCSGTU.h b/TRD/Cal/AliTRDCalDCSGTU.h index e425f750120..3b563be7513 100644 --- a/TRD/Cal/AliTRDCalDCSGTU.h +++ b/TRD/Cal/AliTRDCalDCSGTU.h @@ -25,7 +25,7 @@ class AliTRDCalDCSGTU : public TNamed { AliTRDCalDCSGTU(const char *name, const char *title); AliTRDCalDCSGTU(const AliTRDCalDCSGTU &); AliTRDCalDCSGTU& operator=(const AliTRDCalDCSGTU& sh); - virtual ~AliTRDCalDCSGTU() { }; + virtual ~AliTRDCalDCSGTU(); Int_t GetRunNumber() const { return fRunNumber; } Int_t GetSORFlag() const { return fSORFlag; } diff --git a/TRD/Cal/AliTRDCalDCSGTUTgu.cxx b/TRD/Cal/AliTRDCalDCSGTUTgu.cxx index 925630f9b65..627a67a977f 100644 --- a/TRD/Cal/AliTRDCalDCSGTUTgu.cxx +++ b/TRD/Cal/AliTRDCalDCSGTUTgu.cxx @@ -77,6 +77,27 @@ AliTRDCalDCSGTUTgu::AliTRDCalDCSGTUTgu(const AliTRDCalDCSGTUTgu&) // // AliTRDCalDCSGTU constructor // + +} + +//_____________________________________________________________________________ +AliTRDCalDCSGTUTgu::~AliTRDCalDCSGTUTgu() +{ + // + // AliTRDCalDCSGTU destructor + // + + if (fBoardInfo) { + delete fBoardInfo; + fBoardInfo = 0x0; + } + + if (fCtpOpcArr) { + fCtpOpcArr->Delete(); + delete fCtpOpcArr; + fCtpOpcArr = 0x0; + } + } //_____________________________________________________________________________ diff --git a/TRD/Cal/AliTRDCalDCSGTUTgu.h b/TRD/Cal/AliTRDCalDCSGTUTgu.h index 6f8139196f1..25912cf0cbf 100644 --- a/TRD/Cal/AliTRDCalDCSGTUTgu.h +++ b/TRD/Cal/AliTRDCalDCSGTUTgu.h @@ -25,7 +25,7 @@ class AliTRDCalDCSGTUTgu : public TNamed { AliTRDCalDCSGTUTgu(const char *name, const char *title); AliTRDCalDCSGTUTgu(const AliTRDCalDCSGTUTgu&); AliTRDCalDCSGTUTgu &operator=(const AliTRDCalDCSGTUTgu &sh); - virtual ~AliTRDCalDCSGTUTgu() { }; + virtual ~AliTRDCalDCSGTUTgu(); Int_t GetFromRunNumber() const { return fFromRunNum; } Int_t GetFromSORFlag() const { return fFromSORFlag; } @@ -55,7 +55,7 @@ class AliTRDCalDCSGTUTgu : public TNamed { TString fBusyMask; // value of the attribute named value within the busymask tag TString fContribMask; // value of the attribute named value within the contribmask tag - AliTRDCalDCSGTUBoardInfo *fBoardInfo; // BoarrdInfo Object holding the information about the tgu + AliTRDCalDCSGTUBoardInfo *fBoardInfo; // BoardInfo Object holding the information about the tgu TObjArray *fCtpOpcArr; // an array of AliTRDCalDCSGTUCtpOpc objects holding their configuration data