problem with TList

From: mayer@ik1.fzk.de
Date: Mon Aug 03 1998 - 10:36:45 MEST


Dear Rooters,

there seems to be a problem with TList::Clear in case that the stored object
is a file or directory pointer. After calling Clear, the object is not only
removed from the list but is itself erased? This is not the case with
TOrdCollection. See example:
{
gROOT.Reset();

printf("test TOrdColl..\n");
fr = new TFile("test.root","recreate");
TList *list = new TOrdCollection();
list.Add(fr);
fr.ls();
list.Clear();
fr.ls();

delete list;
delete fr;
gROOT.Reset();

printf("\n");
printf("test TList..\n");
fr = new TFile("test.root","recreate");
TList *list = new TList();
list.Add(fr);
fr.ls();
list.Clear();
fr.ls();

}
and the output

Enclose multiple statements between { }.
root [0] .x test.C
test TOrdColl..
TFile**         test.root
 TFile*         test.root
TFile**         test.root
 TFile*         test.root

test TList..
TFile**         test.root
 TFile*         test.root

 *** Break *** segmentation violation

thanks..
          Hajo! 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:35 MET