Re: [ROOT] on whether to delete root objects

From: Thomas Bretz (tbretz@uni-sw.gwdg.de)
Date: Thu Nov 01 2001 - 11:27:29 MET


Hi Rene,

does this mean, that:

{
TList *list = new TList;
MyClass a;
MyClass *b = new MyClass;
list.Add(&a);
list.Add(b);
list->SetOwner();
[...]
delete list;
}

is correct code and does no segfault?

Regards,
Thomas.

> With
>  - MyClass *c = new MyClass(); c is on the heap
>  - MyClass c;  c is in the stack
> 
> > Something I never understood... When is a object 'on the heap'?



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:05 MET