]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Corrected deletion, additional protection
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Aug 2004 19:30:39 +0000 (19:30 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Aug 2004 19:30:39 +0000 (19:30 +0000)
EMCAL/AliEMCALRecPoint.cxx

index 38ec13e4d3390be88dd82a43fa307f524487210d..de07c97ebb2affdc810476242b023c79c414582b 100644 (file)
@@ -577,15 +577,16 @@ void  AliEMCALRecPoint::EvalParents(TClonesArray * digits)
        fMulParent++ ;
       } // store it
     } // all parents in digit
        fMulParent++ ;
       } // store it
     } // all parents in digit
-    delete newparentarray ; 
+    delete [] newparentarray ; 
   } // all digits
 
   } // all digits
 
-  
-  fParentsList = new Int_t[fMulParent] ;
-  for(index = 0; index < fMulParent; index++)
-   fParentsList[index] = tempo[index] ;
+  if (fMulParent>0) {
+    fParentsList = new Int_t[fMulParent] ;
+    for(index = 0; index < fMulParent; index++)
+      fParentsList[index] = tempo[index] ;
+  }
  
  
-  delete tempo ;
+  delete [] tempo ;
 
 }
 
 
 }