Fix for memory leaks
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Jul 2010 07:25:33 +0000 (07:25 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Jul 2010 07:25:33 +0000 (07:25 +0000)
PMD/AliPMDtracker.cxx

index e3e8284..0435d94 100644 (file)
@@ -240,8 +240,8 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
        }
     }
 
-  AliPMDDiscriminator *pmddiscriminator = new AliPMDEmpDiscriminator();
-  pmddiscriminator->Discrimination(fPMDcontin,fPMDcontout);
+  AliPMDEmpDiscriminator pmddiscriminator;
+  pmddiscriminator.Discrimination(fPMDcontin,fPMDcontout);
 
   const Float_t kzpos = 361.5;    // middle of the PMD
 
@@ -341,6 +341,7 @@ void AliPMDtracker::Clusters2Tracks(AliESDEvent *event)
       esdpmdtr->SetClusterSigmaY(rady);
 
       event->AddPmdTrack(esdpmdtr);
+      delete esdpmdtr;
     }
 
   fPMDcontin->Delete();