Delete AliRawEvent before taking the next one. The problem caused huge memory leak...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 May 2006 10:13:22 +0000 (10:13 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 May 2006 10:13:22 +0000 (10:13 +0000)
RAW/AliRawReaderRoot.cxx

index 6d1799f..71aabc0 100644 (file)
@@ -463,12 +463,11 @@ Bool_t AliRawReaderRoot::NextEvent()
   if (!fFile) return kFALSE;
 
   do {
-    if (fBranch->GetEntry(fEventIndex+1) <= 0) {
-      delete fEvent;
-      fEvent = new AliRawEvent;
-      fBranch->SetAddress(&fEvent);
+    delete fEvent;
+    fEvent = new AliRawEvent;
+    fBranch->SetAddress(&fEvent);
+    if (fBranch->GetEntry(fEventIndex+1) <= 0)
       return kFALSE;
-    }
     fEventIndex++;
   } while (!IsEventSelected());
   return Reset();