Correct a memory leak (due to usage of TPair -> replaced with AliMUONObjectPair ...
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Oct 2006 15:58:29 +0000 (15:58 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Oct 2006 15:58:29 +0000 (15:58 +0000)
MUON/AliMUON2DMapIterator.cxx
MUON/AliMUON2DMapIterator.h

index 507b82f..785a8c0 100644 (file)
@@ -20,6 +20,7 @@
 #include "TMap.h"
 #include "AliLog.h"
 #include "AliMpIntPair.h"
+#include "AliMUONObjectPair.h"
 
 /// \class AliMUON2DMapIterator
 /// \brief Implementation of AliMUONVDataIterator for 2Dmaps
@@ -105,8 +106,10 @@ AliMUON2DMapIterator::Next()
     delete fIter2;
     fIter2 = new TExMapIter(m->GetIterator());
     o = GetValue(*fIter2,fCurrentJ);
-  }
-  return new TPair(new AliMpIntPair(fCurrentI,fCurrentJ),o);
+  }  
+  return new AliMUONObjectPair(new AliMpIntPair(fCurrentI,fCurrentJ),o,
+                               kTRUE, /* owner of intpair */
+                               kFALSE /* but not of o */);
 }
 
 //_____________________________________________________________________________
index 93179ef..3d30bd9 100644 (file)
@@ -32,7 +32,7 @@ public:
   
   virtual ~AliMUON2DMapIterator();
   
-  /** The object returned by this iterator is a TPair(TObject* key,TObject* value)
+  /** The object returned by this iterator is an AliMUONObjectPair(TObject* key,TObject* value)
     where key is an AliMpIntPair (detElemId,manuId), and value is 
     an AliMUONVCalibParam.
     The returned object must be deleted by the user.