Strange problem with TH1F::Dump()


mucha@he112-37 ~]$ root Event.root // from $(ROOTSYS)/test or any other file
root [0]
Attaching file Event.root as _file0...
Warning in <TClass::TClass>: no dictionary for class Event is available
Warning in <TClass::TClass>: no dictionary for class EventHeader is available
Warning in <TClass::TClass>: no dictionary for class Track is available
root [1] T->Draw("fPy>>h1(100,-5,5)")
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [2] h1->Dump()
==> Dumping object at: 0x0a106d60, name=h1, class=TH1F
all OK
root [3] T->Draw("fPx>>h1(100,-5,5)")
root [4] h1->Dump() 
*** Break *** segmentation violation
 Generating stack trace...

What is wrong ?
I tryed on root 4.04.02f, 5.02.00 and CVS(~4-5 days old), result is always the same.

Thanks, Jan

After calling:
T->Draw(“fPy>>h1(100,-5,5)”) ;
you should do:
TH1 h1 = (TH1)gDirectory->FindObject(“h1”);

In your case, the first TTree::Draw produces a TH1 named “h1” in the current
directory. When calling h1.Draw, CINT gets a pointer h1 to “h1”.
However the second TTree::Draw recreates a new TH1 named “h1” and deletes the previous h1.
When doing h1.Draw, h1 points to the old h1 that has been deleted meanwhile.