Fixing memory leaks (Christian)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Dec 2007 14:49:55 +0000 (14:49 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 5 Dec 2007 14:49:55 +0000 (14:49 +0000)
EVGEN/AliGenCorrHF.cxx
HLT/PHOS/AliHLTPHOSMapper.cxx

index 3f46419..707271d 100644 (file)
@@ -592,9 +592,9 @@ Int_t AliGenCorrHF::IpBeauty(TRandom* ran)
 Double_t AliGenCorrHF::ComputeIntegral(TFile* fG)       // needed by GetQuarkPair
 {
    // Read QQbar kinematical 5D grid's cell occupancy weights
-   Int_t* cell = new Int_t[6];           // cell[6]={wght,iy1,iy2,ipt1,ipt2,idph}
+   Int_t cell[6];           // cell[6]={wght,iy1,iy2,ipt1,ipt2,idph}
    TTree* tG = (TTree*) fG->Get("tGqq");
-   tG->GetBranch("cell")->SetAddress(cell);
+   tG->GetBranch("cell")->SetAddress(&cell);
    Int_t nbins = tG->GetEntries();
 
    //   delete previously computed integral (if any)
@@ -621,9 +621,9 @@ void AliGenCorrHF::GetQuarkPair(TFile* fG, Double_t* fInt, Double_t &y1, Double_
                                  // modification of ROOT's TH3::GetRandom3 for 5D
 {
    // Read QQbar kinematical 5D grid's cell coordinates
-   Int_t* cell = new Int_t[6];           // cell[6]={wght,iy1,iy2,ipt1,ipt2,idph}
+   Int_t cell[6];           // cell[6]={wght,iy1,iy2,ipt1,ipt2,idph}
    TTree* tG = (TTree*) fG->Get("tGqq");
-   tG->GetBranch("cell")->SetAddress(cell);
+   tG->GetBranch("cell")->SetAddress(&cell);
    Int_t nbins = tG->GetEntries();
    Double_t rand[6];
    gRandom->RndmArray(6,rand);
index 37e81e7..5805146 100644 (file)
@@ -34,7 +34,8 @@ AliHLTPHOSMapper::AliHLTPHOSMapper() : AliHLTPHOSBase(), fHw2geomapPtr(0)
 
 AliHLTPHOSMapper::~AliHLTPHOSMapper()
 {
-  
+  delete []  hw2geomapPtr;
+  hw2geomapPtr = 0;
 }
 
 void