The question is:  When the object is removed, will ONLY the
still-referenced
VertexArray be left in memory (due to the reference to it)?

Or will the fact that the Geometry has a still-referenced VertexArray
cause
that Geometry or Geode (...or...?) to ALSO be left in memory because it
couldn't be fully removed?

I would say only a VertexArray remains, since the destructor of Geometry
calls destructors of all its members. So if its member is a ref_ptr, the
ref_ptr destructor will decrement the refcount of the object it points
to (which will destroy that object depending on whether refcount now
equals 0, but it should not stop in any way the destructor of the
Geometry).

More precisely, all ref_ptr members (and any other members) of Geometry
are destroyed when Geometry destructor is called, but the
osg::Referenced objects enclosed by ref_ptr members will live or die
depending on whether their refcount reached zero at destruction of
Geometry's ref_ptr members. Hopefully, others will correct me if I am
wrong.

Sinisa

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

Reply via email to