Hi Cory,

Do you find that normal OSG apps have problems when shutting down?

Which version of the OSG are you using?

When you say delete, exactly how are you going about delete?  Could
you supply an example of the clean up code you are using, it does
sound like there is something amiss.

Robert.

On Mon, Jun 22, 2009 at 4:19 PM, Cory Riddell<[email protected]> wrote:
> Hi Robert,
>
> The reason I started to look at this flag is because I'm getting frequent
> access violations when shutting down my app.
>
> Usually, the problem is in GraphicsContext::runOperations().
>
> When I shut down, I call setDone(true) on my viewer instance. I also call
> stopThreading() and make sure that getAllThreads(threads, true) returns 0,
> then I delete everything. I thought this would be sufficient, but I'm still
> getting an access violation in GraphicsContext::runOperations() when it
> tries to dereference a camera pointer and the camera has been deleted. My
> scene includes two cameras, the primary one and a second one to render the
> background.
>
> Is there some other indicator that OSG threads are still running that I
> should be waiting on?
>
> Cory
>
> Robert Osfield wrote:
>
> HI Cory,
>
> The Done flag is a hint to say tell threads that work should stop, so
> once it's stopped you want to reset things so that we you start the
> threads again it doesn't think that it's done again.
>
> Robert.
>
> On Mon, Jun 15, 2009 at 9:37 PM, Cory Riddell<[email protected]> wrote:
>
>
> ViewerBase::stopThreading() includes this block of code:
>
>   for(Cameras::iterator camItr = cameras.begin();
>       camItr != cameras.end();
>       ++camItr)
>   {
>       osg::Camera* camera = *camItr;
>       Renderer* renderer = dynamic_cast<Renderer*>(camera->getRenderer());
>       if (renderer)
>       {
>           renderer->setGraphicsThreadDoesCull( true );
>           renderer->setDone(false);
>       }
>   }
>
> Since threading is being stopped, shouldn't the line in red be setting done
> to true?
>
> Cory
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to