HI Gordon,

On 11/22/06, Gordon Tomlinson <[EMAIL PROTECTED]> wrote:
I understand the point but the Gents example was not using a Ref pointer,
hence the way I replied :)

The best advice was to use ref_ptr<> without a shadow of doubt.

But I would also argue that theres nothing wrong in using unref() if you
know what the life cycle of your object is.

It is not a robust way to program.  What happens when an exception
occurs?  Memory leak?  what happens if you move the code around a bit
and the code path missing a ref/unref?  Calling unref() mannually is a
*bad* programming practice that one shouldn't get it in.

ref_ptr<> is your friend, it will help your out immensely, it frees
you from worry about memory management because it does it so robustly.

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

Reply via email to