]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing memory leaks
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Jan 2004 17:06:01 +0000 (17:06 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Jan 2004 17:06:01 +0000 (17:06 +0000)
ITS/AliITStrackerV2.cxx
ITS/AliV0vertexer.cxx

index 33ca6f78ea7a9c833618cc2cbeec0265a5a647cc..f2654866dcb497ffa06bbe76d982a8b692381d0f 100644 (file)
@@ -197,7 +197,10 @@ Int_t AliITStrackerV2::Clusters2Tracks(AliESD *event) {
         delete t;
         continue;
       }
-      if (TMath::Abs(t->GetD())>4) continue;
+      if (TMath::Abs(t->GetD())>4) {
+       delete t;
+       continue;
+      }
 
       if (CorrectForDeadZoneMaterial(t)!=0) {
          Warning("Clusters2Tracks",
@@ -284,11 +287,15 @@ Int_t AliITStrackerV2::Clusters2Tracks(TTree *tpcTree, TTree *itsTree) {
            delete t;
            continue;
        }
-       if (TMath::Abs(t->GetD())>4) continue;
+       if (TMath::Abs(t->GetD())>4) {
+        delete t;
+        continue;
+       }
 
        if (CorrectForDeadZoneMaterial(t)!=0) {
         Warning("Clusters2Tracks",
                  "failed to correct for the material in the dead zone !\n");
+        delete t;
          continue;
        }
 
index 120a926506349cf1d0ec458d989ec1cf6df158f9..42961a96564b61a0b836290bd19f41dffe8080fd 100644 (file)
@@ -54,8 +54,14 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
      AliITStrackV2 *iotrack=new AliITStrackV2(*esd);
      iotrack->SetLabel(i);  // now it is the index in array of ESD tracks
      if ((status&AliESDtrack::kITSrefit)==0)   //correction for the beam pipe
-        if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue;
-     if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
+        if (!iotrack->PropagateTo(3.,0.0023,65.19)) {
+         delete iotrack;
+         continue;
+       }
+     if (!iotrack->PropagateTo(2.5,0.,0.)) {
+       delete iotrack;
+       continue;
+     }
 
      if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);}
      else {npos++; postrks.AddLast(iotrack);}
@@ -146,8 +152,14 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
        branch->SetAddress(&iotrack);
        tTree->GetEvent(i);
 
-       if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue; 
-       if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
+       if (!iotrack->PropagateTo(3.,0.0023,65.19)) {
+        delete iotrack;
+        continue; 
+       }
+       if (!iotrack->PropagateTo(2.5,0.,0.)) {
+        delete iotrack;
+        continue;
+       }
 
        if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);}
        else {npos++; postrks.AddLast(iotrack);}