TFile * AliQAv1::GetQAResultFile()
{
// opens the file to store the Quality Assurance Data Checker results
- if (fgQAResultFile && fgQAResultFile->IsOpen())
- {
+ if (fgQAResultFile) {
+ if (fgQAResultFile->IsOpen())
fgQAResultFile->Close();
+ delete fgQAResultFile;
}
- delete fgQAResultFile;
- fgQAResultFile=0x0;
-
TString dirName(fgQAResultDirName) ;
if ( dirName.Contains(fgkLabLocalFile))
dirName.ReplaceAll(fgkLabLocalFile, "") ;
opt = "NEW" ;
}
fgQAResultFile = TFile::Open(fileName, opt) ;
-
- return fgQAResultFile ;
+ return fgQAResultFile ;
}
//_______________________________________________________________
// Get an instance of the singleton. The only authorized way to call the ctor
if ( ! fgQA) {
- TFile * f = GetQAResultFile() ;
- fgQA = static_cast<AliQAv1 *>(f->Get("QA")) ;
- f->Close() ;
+ GetQAResultFile() ;
+ fgQA = static_cast<AliQAv1 *>(fgQAResultFile->Get("QA")) ;
if ( ! fgQA )
fgQA = new AliQAv1() ;
}
// Get an instance of the singleton. The only authorized way to call the ctor
if ( ! fgQA) {
- TFile * f = GetQAResultFile() ;
- fgQA = static_cast<AliQAv1 *>(f->Get(GetQAName())) ;
+ GetQAResultFile() ;
+ fgQA = static_cast<AliQAv1 *>(fgQAResultFile->Get(GetQAName())) ;
if ( ! fgQA )
fgQA = new AliQAv1(det) ;
}