Hi John, The osg::Switch doesn't delete subgraphs when you toggle children on/off, it simply disables the traversal of the "off" children. A switch is for switching between one or more children where the change is not permanent, i.e. children may be switch on/off through the lifetime of the application.
You can't hide your model and free memory associated with it withought removing it from the scene graph completely. Group::removeChild() is the method you want to use. Robert. On 30 May 2016 at 03:21, John Lee <[email protected]> wrote: > Hi all! > > I add a model to the osg::Switch node and set it on. And it goes well in OSG > window. But when I turn the switch node to off, the model is invisible while > the memory still not free. Can anyone tell me why it happen? Or is there any > way that I can hide my model and free memory dynamically? > > Thank you! > > Cheers, > John > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=67269#67269 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

