Hi Thomas,
Is the code
{TList l; l.Add(new TNamed); l.SetOwner(); }
executed in the interpreted or compiled code. The interpreted has some odd behavior (That we are currently working to fix) regarding object lifetime.
Cheers,
Philippe.
-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Thomas Bretz
Sent: Friday, May 14, 2004 9:14 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] Strange behaviour of gObjectTable...
Hi,
I found some strange behaviour of gObject Table which I don't understand.
Mayeb somebody can comment on it...
If I do:
TObject::SetObjectStat(1);
{ TList *l = new TList; l->Add(new TNamed); l->SetOwner(); delete l; }
gObjectTable->Print();
everything looks like expected.
If I do:
TObject::SetObjectStat(1);
{TList l; l.Add(new TNamed); l.SetOwner(); }
gObjectTable->Print();
the TNamed object seems still to remain in memory.
Moreover if I do this twice only a single TNamed objects seems to be there
instead of the expected two.
If I now quit the interpreter I get a lot of warnings like:
Warning in <TObjectTable::Remove>: 0x737746728 not found at 687763
tested with root 3/05.01 on Darwin and 3.05/07 on linux.
Any idea or explanation? (We try to find a memory leak in our shared
object, but gObjectTable returns all objects which should be automatically
deleted with lists as existing...)
Thomas.
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET