Page 1 of 1

CEGUI object deletes childs ?

Posted: Sun Jul 18, 2010 19:57
by Akis
Hi,

I'm wondering if a CEGUI object automaticaly deletes their childs when he died...

For example, if I do this : obj->addItem(new Item("blablabla"));

If I call "delete obj;" obj will deletes the new item or I have to delete it myself ?

Thanks

Re: CEGUI object deletes childs ?

Posted: Mon Jul 19, 2010 17:33
by Jamarr
Yes, parents automatically delete children when they are destroyed. This setting can be changed via Window::setDestroyedByParent.

Re: CEGUI object deletes childs ?

Posted: Tue Jul 20, 2010 01:13
by Akis
I wasn't be sure ;)

Thanks for the confirmation !