I am using Version 5.12/00e on SUSE LINUX Enterprise Server 9 (x86_64).
Following simple script crashes although that compiled with ALiC runs fine.
Is this one of CINT limitations?
this is a bit unfortunate :-/ When you close the TFile, it checks whether the histogram (which it owns, see object ownership in the user’s guide) was created on the heap; if it was, it’ll take care of deleting it. When compiling your macro it all works nicely - the histogram is created on the stack, so the TFile won’t delete it.
But CINT has to emulate the stack: it creates it on the heap and rememebrs to delete it when the function returns, just as if it was a stack object going out of scope. This of course clashes with TFile’s interpretation of who’s responsible for deleting it. The solution is to add the line “hn.SetDirectory(0);”. This should not change anything for the compiled case, but is a work-around for the interpreted case.
Thank you for kindly telling me what’s going on inside.
So, I suppose that another convenient solution is making sure to create objects always on heap.