Hi J-S,

> One thing you need to be careful of when deriving classes from OSG base
> classes which themselves derive from osg::Referenced ... In most cases,
> the destructors of those classes should be protected. Since they're
> normally protected already (as in osg::Object, osg::Drawable, etc) you
> shouldn't expose them in public scope in your derived class, which
> would
> allow them to be (erroneously) deleted at any time by the application
> instead of being deleted automatically when their ref count goes down
> to 0.

That was the problem.  The destructor of my derived class was public.  I 
changed it to protected and to use a ref_ptr for the class and no more crashes. 
 I'm not sure I would have ever found this bug.  I wasn't even looking in that 
direction.  So, thanks so much!

chuck
 
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  • [osg-use... Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
    • Re:... Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
    • Re:... Jean-Sébastien Guay
      • ... Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
        • ... Jean-Sébastien Guay
          • ... Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
            • ... Jean-Sébastien Guay
    • Re:... David Spilling
      • ... Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]

Reply via email to