Problem Closing a RootFile

Dear ROOTers;

when I try to close a RootFile after “Cloning” a histogram, I get the following error:

 *** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library "/lib64/tls/libthread_db.so.1".
...
...
...

My code is:

  TString filename1("../dir1/rootFile_"+HTmin+"-"+HTmax+".root");
  TFile *f1 = TFile::Open(filename1,"READONLY");
  TH2D *hCloneHisto = InitialHisto->Clone();
  f1->Close();

Thank you in advance for your help.

cheers – loukas

Hi,

call hCloneHisto->SetDirectory(0). See the users guide about files and histograms (“Creating Histograms”).

Cheers, Axel.

Hi,
this solved my problem.

Many thanks,
loukas