Thanks Jason, changes look sound and are now merged and submitted to svn/trunk.

On Thu, Oct 29, 2009 at 2:21 PM, Jason Beverage <[email protected]> wrote:
> Hi Robert,
>
> I posted a question on osg users about resources not being properly released
> when using osgTerrain databases and multiple viewers are used a few weeks
> ago and I've found that at least part of the problem comes down to the fact
> that the nodes that are traversed by the GeometryTechnique are never
> actually added to the scene graph, and thus don't have releaseGLObjects
> called on them.  I'm submitting a few changes that takes care of this by
> allowing the TerrainTechnique to provide a releaseGLObjects implementation.
> I've applied these changes in osgEarth and this example program no longer
> crashes on the second run, although I get corrupt geometry (see attached
> shot) which could be down to a driver issue.  If I increment the context ID
> for the second viewer, I no longer get the corrupt geometry.
>
> The attached changes are against OpenSceneGraph 2.8.2.
>
> //Sample program.  Run against an osgEarth or VPB database based on
> osgTerrain.
> #include <osgDB/ReadFile>
> #include <osgViewer/Viewer>
>
> int main(int argc, char** argv)
> {
>    osg::ArgumentParser arguments(&argc,argv);
>
>    osgViewer::Viewer* viewer = new osgViewer::Viewer();
>    viewer->setUpViewInWindow(100,
> 100,500,500);
>    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
>    viewer->setSceneData( loadedModel.get() );
>    viewer->run();
>    delete viewer;
>
>    viewer = new osgViewer::Viewer();
>    viewer->setUpViewInWindow(100,100,500,500);
>    loadedModel = osgDB::readNodeFiles(arguments);
>    viewer->setSceneData( loadedModel.get() );
>    viewer->run();
>    delete viewer;
> }
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to