Hi Tetsuo, The problem occurs when the TPaveStats is created with no parent. Now protected in the CVS code. Thanks for reporting this. Rene Brun On Wed, 4 Sep 2002, Tetsuo Arisawa wrote: > > Hello, > > I have troubles handling a TCanvas read from a file > when I use the newest ROOT version, v3.03. > Segmentation faults occur when I clear or delete the canvas. > This has not happened in using the older ROOT versions. > (I do not know how the file is created in detail.) > > According to a release note, TPaveStats class is updated from v3.03. > So when I click one of two TPaveStats on the canvas by right mouse > button > and choose "Delete", then the segmentation fault shows up. > > In the source code of v.303, the updated destructor contain a line: > > if (!fParent->TestBit(kInvalidObject)) > fParent->RecursiveRemove(this); > > that the v.3.02 does not have. > I think the line should be > > if ( fParent && !fParent->TestBit(kInvalidObject)) > fParent->RecursiveRemove(this); > > for stability. How do you think? > > You could reproduce the phenomena: > > { > gROOT->Reset(); > > TCanvas *c = new TCanvas( "c","canvas",500,500); > TPaveStats *stats = new TPaveStats(0.1,0.1,0.9,0.9); > stats->AddText("STATS"); > stats->Draw(); > stats->SetBit( kCanDelete ); > } > > Then test one of the following: > 1. c->Delete(); or delete c; > 2. c->Clear(); > 3. mouse right click on TPaveStats and choose Delete. > > If you do the following, segmentation fault disappears. > stats->SetParent(c); > > Regards > Tetsuo Arisawa > Waseda Univ. Japan / CDF > >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:08 MET