]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderRoot.cxx
Delete AliRawEvent before taking the next one. The problem caused huge memory leak...
[u/mrichter/AliRoot.git] / RAW / AliRawReaderRoot.cxx
index 6d1799f77fbc15f3e310849d46cc826567712d90..71aabc0b3f4cb4ab74781d85a19760f499d16bfa 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();