Hi Manoj,

The OSG users smart pointers (ref_ptr<>) internally so if you add data
to it will be managed robustly and without memory leaks.  In you case
just passing the objects into the scene graph will likely mean that
everything will be managed for you.

As Serge says read the docs of ref_ptr.

Robert.

On 6/30/06, Manoj Radhakrishnan <[EMAIL PROTECTED]> wrote:
Dear All,

Sorry for disturbing you more.
I am a newcomer in graphics programming.

May I ask one clarification....

There are 14 primitives(Cuboid, Torus, Cylinder
etc...)
supported in my application.

For this I use derived class of osg::Geode for each
primitives.

There is a UpdateGeometry() function in each class.

This function is called each time when any change in
shape.

Please see some code in this function....

            The tesselation code will change according
to the changes needed
            and kept the vertices and normals as
member variable of this class

            // Remove all the drawables in the geode
            while(getNumDrawables())
                removeDrawable(0, 1);

            osg::Geometry* meshGeometry = new osg::Geometry;


            ...

            ....

            // Add the geometry to the geode
           addDrawable(meshGeometry);

Now adding vertex array, normal array,
primitiveset, color array, color indices and stateset
after
dynamically creating the respective classes.

How to deallocate the above objects ?.
I think delete operator not working with these
objects.

Is this is a correct way ?

I think this will result in memory leaks.

Thanks in advance,

Manoj






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to