form David Rohr: Fix crash during QA part of rec.C
authormkrzewic <mikolaj.krzewicki@cern.ch>
Fri, 16 Jan 2015 15:34:34 +0000 (16:34 +0100)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Fri, 16 Jan 2015 15:34:34 +0000 (16:34 +0100)
AliHLTQADataMakerRec.cxx:
previously set gDirectory to 0 temporarily, in order to prevent
histograms beeing added to current directory. With new root,
this causes a crash during TObject::clone. Hence we use the
propper way to disable histograms beeing added to gDirectory
temporarily, and reset it afterwards

HLT/QA/AliHLTQADataMakerRec.cxx

index d444baf..c688843 100644 (file)
@@ -141,8 +141,8 @@ void AliHLTQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
   // see header file for class documentation
   TIter next(&fPlugins);
   TObject* obj=NULL;
-  TDirectory* dirBackup=gDirectory;
-  gDirectory=NULL;
+  Bool_t dirStatusBackup = gDirectory->AddDirectoryStatus();
+  gDirectory->AddDirectory(kFALSE);
   while ((obj=next())) {
     AliHLTQADataMakerBase* plugin=dynamic_cast<AliHLTQADataMakerBase*>(obj);
     if (!plugin) continue;
@@ -172,7 +172,7 @@ void AliHLTQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
       }
     }
   }
-  gDirectory=dirBackup;
+  gDirectory->AddDirectory(dirStatusBackup);
 }
 
 void AliHLTQADataMakerRec::MakeRaws(AliRawReader * rawReader)