Hello,
 
osg uses smart pointers.  Most classes in osg are derived from
osg::Referenced.  This class prohibits you from deleting it by making the
destructor protected.  This is on purpose.  This way you don't have to worry
about deleting objects.
 
There is a link for a tutorial on this, but I cannot seem to find it.
Basically, if you create osg::Box, it will destroy itself when there are no
references to it.  It gets references when it is added as a child of some
other node.
 
 

Zach


 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of N. Farr
Sent: Friday, February 02, 2007 20:08
To: osg-users@openscenegraph.net
Subject: [osg-users] Question about memory cleanup (OSG beginner)


Hello all,
 
I have been looking at the NPS tutorial code and also around the website and
cannot find useful mention of how to delete pointers to osg objects. The
typical delete osgBox for example produces this error: error C2248:
'osg::Box::Box' : cannot access protected member declared in class
'osg::Box'. I have looked at the DeleteHandler class but hit a dead end. Any
help (preferably some sample code) would be much appreciated.
 
Thank you.
 
N. Farr



  _____  

Stay up-to-date with your friends through the Windows LiveT Spaces friends
list. Check it out!
<http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx
&mkt=en-us>  
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to