Wouzz wrote:
> 
> I have a subsidiary question : let be a node defined inside a method, 
> existing only as a child of a group. Is this node deleted after calling the 
> removeChild method? 'cause I'm doing this everywhere... 
> 
> ----------
> void test()
> {
> ref_ptr<Node> myNode = new Node();
> ref_ptr<Group> myGroup = new Group();
> 
> myGroup->addChild(myNode);
> 
> // ...
> 
> myGroup->removeChild(myNode);
> }
> 
> int main()
> {
> 
> test();
> 
> // At this point, is myNode still in memory ???
> 
> }
> ---------
> Ku


Yes, I've used that and it does clear the node - as far as I can tell. I used 
it when I had to clear an object in a tree. Then I used new to use that child 
again. 

I've also used removeChildren to clear all the children in a group. I've found 
this useful for clearing primitives in a hud for example.

So far, I've checked this out using 'top' and it looks like it works for me! 

If I'm wrong, please someone please clarify this to me! 

Memory handling has always been my worse subject in CS!

D Glenn

------------------------
D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your 
Desk!

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27954#27954





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to