HI Adrian, This change creates a circular reference, as the Program owns the PerContextProgram and the PerContextProgram owns the Program so will introduce a memory leak.
A solution to the problem you are seeing with have to be made elsewhere. Which version of the OSG are you using? There was a bug in OSG-2.8.0 in the State's handling of cached program objects that has now been fixed in svn/trunk and OSG-2.8 branch. Robert. On Thu, Feb 26, 2009 at 7:20 AM, Adrian Egli OpenSceneGraph (3D) <[email protected]> wrote: > Hi Robert, > > I wrote some weeks ago that we have a bug once we added a 2nd context > (fullscreen). Once we add this we get a new object > osg::Program::PerContextProgram appended to the _pcpList, which stores the > program it's self. Once we remove the fullscreen context before the program > exits, it stills runs ok, but once we close the application it crash, > because the program is no longer avaible, removed to early by another part. > so we tested and check against memory leaks, no problem. works fine, and all > created program object gets removed also the osg::Program::PerContextProgram > . > > /** Pointer to our parent Program */ > //const Program* _program; > osg::ref_ptr<const Program> _program; > > /adrian > > -- > ******************************************** > Adrian Egli > > _______________________________________________ > 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
