Hi,
I’m having trouble trying to come up with a script short enough for posting, but let my try to just describe the problem.
I have a class describing a tree which is initialized in the main program. In a subroutine, I open a file (declared global) for writing and switch to it:
outFile = new TFile(outFileName,"recreate"); //open output file
fTree->SetDirectory(outFile);
Then, at the end when I do:
outFile->cd();
fTree->Write();
outFile->Write();
outFile->Close();
it segfaults at the writing stage. This does not happen if I exclude the setdirectory statement from the upper piece of code (then I have other problems).
I tried putting a strange statement
outFile = fTree->GetCurrentFile();
after SetDirectory, which did not help. Do you have any suggestions? I’ll try to see whether the code can be reduced to “postable” size, but I do not have much hope.
Slava