]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix for inproper merging of some components.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Jan 2011 10:41:58 +0000 (10:41 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Jan 2011 10:41:58 +0000 (10:41 +0000)
(M. Ivanov)

ANALYSIS/AliFileMerger.cxx

index 11b76b60b68840f32c2b9f2d925e568f8f048f96..03a00d7db839acb7d9cfd68f9f35839b3c0051bd 100644 (file)
@@ -163,7 +163,7 @@ void AliFileMerger::IterTXT( const char * fileList,  const char* outputFileName,
   else {
     StoreResults(mergeArray, outputFileName);
   }
-
+  
   delete mergeArray;
 }
 
@@ -202,6 +202,7 @@ void AliFileMerger::Merge(TFile* fileIn, TObjArray * array){
   //
   // Merging procedure
   //
+  if (!array) return;
   static Int_t counter=-1;
   counter++;
   TObjArray *carray = new TObjArray;   //array of the objects inside current file
@@ -228,8 +229,8 @@ void AliFileMerger::Merge(TFile* fileIn, TObjArray * array){
     return;
   }
   TMethodCall callEnv;
-  
-  for (Int_t i=0; i<carray->GetEntries(); i++){
+  Int_t entries =carray->GetEntriesFast();
+  for (Int_t i=0; i<entries; i++){
     
     TObjArray *templist = new TObjArray(1);
     templist->SetOwner(kFALSE);
@@ -258,6 +259,7 @@ void AliFileMerger::Merge(TFile* fileIn, TObjArray * array){
     AliSysInfo::AddStamp(currentObject->GetName(),2,i,counter);  
     delete templist;
   }
+  carray->Delete();
   delete carray;
 }