Fix leak due to incomplete cleanup of the AODEvent/AliAnalysisFilter. (Laurent, Jan...
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Dec 2011 15:52:21 +0000 (15:52 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Dec 2011 15:52:21 +0000 (15:52 +0000)
ANALYSIS/AliAnalysisFilter.cxx
ANALYSIS/AliAnalysisFilter.h
STEER/AOD/AliAODEvent.cxx
STEER/AOD/AliAODInputHandler.cxx

index 135cc61..fdddaa6 100644 (file)
@@ -55,6 +55,12 @@ AliAnalysisFilter::AliAnalysisFilter(const AliAnalysisFilter& obj):
     fCuts = obj.fCuts;
 }
 
+AliAnalysisFilter::~AliAnalysisFilter()
+{
+// Destructor
+   if (fCuts) fCuts->Delete("slow");
+   delete fCuts;
+}   
 
 AliAnalysisFilter& AliAnalysisFilter::operator=(const AliAnalysisFilter& other)
 {
index 1bcc360..099b8a0 100644 (file)
@@ -23,7 +23,7 @@ class AliAnalysisFilter : public TNamed
     AliAnalysisFilter(const char* name, const char* title = "AnalysisFilter");
     AliAnalysisFilter(const AliAnalysisFilter& obj);
     AliAnalysisFilter& operator=(const AliAnalysisFilter& other);
-    virtual ~AliAnalysisFilter() {;}
+    virtual ~AliAnalysisFilter();
     virtual UInt_t IsSelected(TObject* obj);
     virtual UInt_t IsSelected(TList* obj);
     virtual Bool_t IsSelected(char* name);
index 26b5da0..cd8c85e 100644 (file)
@@ -236,7 +236,10 @@ AliAODEvent & AliAODEvent::operator=(const AliAODEvent& aod) {
 AliAODEvent::~AliAODEvent() 
 {
 // destructor
-    if(!fConnected) delete fAODObjects;
+    if(!fConnected) {
+       fAODObjects->Delete("slow");
+       delete fAODObjects;
+    }   
     delete fAODFolder;
 }
 
index 1526be3..8ba643a 100644 (file)
@@ -199,6 +199,7 @@ Bool_t AliAODInputHandler::FinishEvent()
 {
   // Finish event
   if (fMixingHandler) fMixingHandler->FinishEvent();
+  if (fEvent) fEvent->Reset();
   return kTRUE;
 }