memory leaks removed;
[u/mrichter/AliRoot.git] / HBTAN / AliHBTEventBuffer.cxx
index a97478e12bd11ec692f518fb0ac66baeb90789eb..60141efc3d36bfe10f0af02d71d631fdca24bd51 100644 (file)
@@ -8,6 +8,10 @@ ClassImp(AliHBTEventBuffer)
 // class AliHBTEventBuffer
 //
 // FIFO type event buffer
+//
+// Piotr.Skowronski@cern.ch
+//
+////////////////////////////////////////////////////////
 
 AliHBTEventBuffer::AliHBTEventBuffer():
  fSize(-1),fEvents(),fIter(&fEvents)
@@ -15,11 +19,25 @@ AliHBTEventBuffer::AliHBTEventBuffer():
   //ctor
 }
 /***********************************************************/
+
 AliHBTEventBuffer::AliHBTEventBuffer(Int_t size):
  fSize(size),fEvents(),fIter(&fEvents)
 {
   //ctor
 }
+/***********************************************************/
+
+AliHBTEventBuffer::~AliHBTEventBuffer()
+{
+  //dtor -- TList::IsOwner(1) does not work - Valgrind says that there is mem leak
+  //take care owerseves
+  if (fEvents.IsOwner())
+   { 
+     AliHBTEvent* e=0x0;
+     while (( e=RemoveLast() )) delete e;
+   }
+}
+/***********************************************************/
 
 AliHBTEvent* AliHBTEventBuffer::Push(AliHBTEvent* event)
 {