http://www.skew-matrix.com/OSGQSG/
p37, Memeory Management Examples. Misspelled "Memory" in the errata. ----------------- p37, Memory Management Examples. There are multiple solutions to the dilemma of how to return a Referenced object address. The method employed in this book's example code is to return a ref_ptr<> storing the address, as the code below illustrates. osg::ref_ptr<osg::Group> createGroup() { osg::ref_ptr<osg::Group> grp = new osg::Group; // Return the new Group's address. This stores the Group // address in a ref_ptr<> and places the ref_ptr<> on the // call stack as the return value. return grp.get(); } Why is it return grp.get(); rather than return grp; Isn't grp.get() a pointer to an osg::Group? _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org