FYI -- As part of my revision to the OSG Quick Start Guide (in progress),
I've modified the current svn head of the example code to use
ref_ptr<>::release(). This technique will be discussed in the upcoming
revision but is not mentioned in the current edition of the book. So I
thought I should discuss it briefly here.
 
ref_ptr<>::release() tells the ref_ptr<> variable to stop managing the
memory that it points to. It will decrement the reference count on the
memory but will not delete the memory, not even if its reference count goes
to zero. This makes release() well-suited for returning the address of
Reference memory from functions that allocate that memory. The function can
use a ref_ptr<> locally to store the address of the allocated memory, return
it with release(), and as long as the calling code store the returned
address in another ref_ptr<>, no memory is deleted and no memory leaks.
 
The source code can be downloaded from:
http://code.google.com/p/osgqsg/admin
 
The current edition of the book can be ordered from www.lulu.com. Just
search for "OpenSceneGraph".
 
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
+1 303 859 9466
 
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to