Hi David,

In the original implementation osgText I wasn't sure whether to make osgText::String a object of osgText::Text, or have pointer to a osgText::String stored in osgText::Text.  In the end I made it an object of osgText::Text, so the returning a reference is certainly the correct thing to do.  Implementing it this way ensures that osgText::Text always has a valid String.

Consolodating on osgText::Text having a osgText::String does mean that the ~String can't be made protected.  It also suggest that osgText::String shouldn't have subclassed from osg::Referenced.

I must admit I haven't look at osgText::String since the early dev days of osgText as String has worked pretty solidy and there hasn't much reason to tinker with it.  But alas it does mean old bit of code haven't yet been cleaned up...

I'll ponder on the deriving from osg::Referenced and check in at least a comment change.

Robert.

On 9/1/06, david callu < [EMAIL PROTECTED]> wrote:
Hi all,


      The osgText::String is derived from osg::Referenced but it have a public destructor and the safe shared memory could be broken.
      in the source :
            virtual ~String() {} // public temporily while osgText is still in flux.
            I don't understand what mean "is still in flux"

      The second strange think is that in osgText::Text::getString(), the function return a reference on osgText::String and not a pointer like any osg::Referenced based class
      Is it the good behavious to return the reference ??


David

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


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

Reply via email to