Inside a constructor, the reference count of 'this' is still zero. If you use a local osg::ref_ptr to reference 'this', the reference count will increment to one. However, when the constructor ends, the lifetime of the osg::ref_ptr also ends, and the reference count will become zero again, and 'this' will be destroyed.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.