Hi Bruno,
hello,

I am doing the following experiment:

osg::ref_ptr<osg::Vec3Array> array(new osg::Vec3Array);
array->resize(300000000);
array->clear();

This does not deallocate the memory.
It is "detaching" the memory. There is no guarantee the memory is actually freed at this point (see std::vector) The only safe way to "de"-allocate a std::vector is to get it out of scope or swap it with an empty vector.
Note that for c++11 there is also a shrink_to_fit.

Cheers
Sebastian

How do I effectively deallocate the memory from the std::vector encapsulated in the osg::Vec3Array?


_______________________________________________
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

Reply via email to