RE: [ROOT] Strange behaviour of gObjectTable...

From: Philippe Canal (
Date: Fri May 14 2004 - 21:13:03 MEST

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.


-----Original Message-----
[]On Behalf Of Thomas Bretz
Sent: Friday, May 14, 2004 9:14 AM
Subject: [ROOT] Strange behaviour of gObjectTable...


I found some strange behaviour of gObject Table which I don't understand.
Mayeb somebody can comment on it...

If I do:
{ TList *l = new TList; l->Add(new TNamed); l->SetOwner(); delete l; }
everything looks like expected.
If I do:
{TList l; l.Add(new TNamed); l.SetOwner(); } 
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...)


This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET