The get() will return a pointer to an object with a protected destructor,
that cannot be deleted (compiler error).

There are very rare exceptions to this rule.

Changing all the passing of pointers in osg to ref_ptr<>& is a complete
change to the OSG interface, too expensive to avoid users' incorrect usage
of pointers (OSG makes a correct usage of ref_ptr, it has no problems within
itself). 

And users may still make incorrect usage in their code. The only way to
avoid this seems removing the get() method. And that would be a huge freedom
penalty to users' code.

________________________________________
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Nathan Bates
Enviado el: martes, 16 de enero de 2007 16:44
Para: osg users
Asunto: Re: [osg-users] ref_ptr and Geode/Geometry

> I'm certainly confused. Is it simply that you don't like doing a
> .get() when passing in an object?

Yes, exactly.

To me, get() implies the criminal act of circumventing
reference-counting to get a raw/direct C pointer to an object
which then becomes vulnerable to being deleted.

Thanks.
 __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to