[osg-users] Problems shutting down Composite Viewer/View/Custom drawables

Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY] charles.e.cole at nasa.gov
Fri Mar 27 11:04:40 PDT 2009


Hi J-S,

When I referred to "destroy", what I'm doing is calling 'delete' on the classes that contain the ref_ptrs.  For instance, I call delete on my view class, and in the view class' destructor, I (eventually) call delete on the drawables. So I'm in effect doing what you're saying, with the exception of the class containing the composite viewer.  I'll change some code around to reflect that and see how it goes.

Thanks.

chuck

> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-
> bounces at lists.openscenegraph.org] On Behalf Of Jean-Sébastien Guay
> Sent: Friday, March 27, 2009 1:45 PM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Problems shutting down Composite
> Viewer/View/Custom drawables
> 
> Hi Charles,
> 
> > My attempted process to close is that I (1) set a flag on a render
> thread to stop calling viewer->frame (very similar to setDone(true));
> (2) destroy the loaded drawables and free their associated libraries;
> (3) destroy the view, and thus it's associated camera and graphics
> context; and (4) destroy the composite viewer.  I use reference
> pointers in every case except for the composite viewer (although I've
> tried a reference pointer for it as well, but still get the same
> result).
> 
> Just wondering, if you're using ref_ptrs, why don't you just let the
> CompositeViewer's ref_ptr go out of scope (or delete the object that
> has
> the ref_ptr<CompositeViewer>) and be done with it? That should cascade
> down, destroying the views, then each view's scene graph. And if your
> custom drawables do the right thing in their destructors, that should
> be
> taken care of too. You shouldn't have to manage destruction order
> yourself.
> 
> Perhaps I'm missing something here, but that generally just works.
> 
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com
>                                 http://www.cm-labs.com/
>                          http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org



More information about the osg-users mailing list