]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Memory leak corrected
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Oct 2002 13:44:09 +0000 (13:44 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Oct 2002 13:44:09 +0000 (13:44 +0000)
HBTAN/AliHBTParticleCut.cxx
HBTAN/AliHBTReaderInternal.cxx

index db244e37c5f0b8942192e0f0d259ba1127e3e7de..40c2a9facc7787430bcd8971c3196886d96a8bc5 100644 (file)
@@ -202,13 +202,15 @@ void AliHBTParticleCut::Streamer(TBuffer &b)
    UInt_t R__s, R__c;
    if (b.IsReading()) 
     {
-      /* Version_t v = */ b.ReadVersion(&R__s, &R__c);
+      Int_t i;
+      for (i = 0;i<fNCuts;i++) delete fCuts[i];
+      b.ReadVersion(&R__s, &R__c);
       TObject::Streamer(b);
       b >> fPID;
       b >> fNCuts;
-      for (Int_t i = 0;i<fNCuts;i++)
+      for (i = 0;i<fNCuts;i++) 
        {
-        b >> fCuts[i];
+         b >> fCuts[i];
        }
        b.CheckByteCount(R__s, R__c,AliHBTParticleCut::IsA());
     } 
index aad455e6a1b12aad9844f3f48fc27c6335d8d0d8..6e59b4ace82ad361c7eb60b4363d5d4c4f504ad9 100644 (file)
@@ -253,15 +253,19 @@ Int_t AliHBTReaderInternal::Read(AliHBTRun* particles, AliHBTRun *tracks)
         totalNevents++;
        }
 
-   /***************************/
-   /***************************/
-   /***************************/
-   currentdir++;
-   aFile->Close();
-   aFile = 0x0;
+    /***************************/
+    /***************************/
+    /***************************/
+    currentdir++;
+    delete tree;
+    aFile->Close();
+    delete aFile;
+    aFile = 0x0;
 
    }while(currentdir < Ndirs);
 
+  delete pbuffer;
+  delete tbuffer;
   fIsRead = kTRUE;
   return 0;
 }