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

index 6ba02cf..5f0d1f3 100644 (file)
@@ -231,6 +231,12 @@ Int_t AliEMCALTriggerTRU::L0()
 */             
                if ( !nPeaks )
                {
+                       //Delete, avoid leak
+                       for (Int_t x = 0; x < xsize; x++)
+                         {
+                           delete [] peaks[x];
+                         }
+                       delete [] peaks;
                        ZeroRegion();
                        continue;
                }
@@ -277,6 +283,8 @@ Int_t AliEMCALTriggerTRU::L0()
                                        if ( AliDebugLevel() ) ShowFastOR(i,idx[index]);
                                }
                        }
+
+                       delete [] idx;
                        
                        if ( !foundPeak ) 
                        {