Hi,

... 
test code like this:

class Test
{
     osg::ref ptr<osg::Group> root = new osg::Group();
     osg::ref ptr<osg::Group> testGroup = NULL;

}

void Test::TestForMeomory(bool value)
{

if  (value)   //adding 50000 nodes

{
    testGroup =  new osg::Group();

    for (int i = 0, i < 50000,i++)
      {
          osg::ref ptr<osg::Node> node = new osg::Node();
          testGroup->addChild(node.get());
     } 

      root ->addChild(testGroup .get());

}else    //remove all chilren
{
          testGroup->removeChildren(0,testGroup->getNumChildren());
          
       root ->removeChild(testGroup .get());

       testGroup = NULL;
 }

}







Thank you!

Cheers,
Lv

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





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

Reply via email to