[osg-users] Removing objects with shared GL state from scene graph

Chris Djali krizdjali at gmail.com
Fri Jul 26 09:46:12 PDT 2019


Hi,


> So... would change the destructor to: 
> 
> 
> Camera::~Camera() 
> { 
>     setCameraThread(0); 
> 
>     if (_graphicsContext.valid()) 
> 
>     { 
>        releaseGLObjects(_graphicsContext->getState()); 
> 
> 
>         _graphicsContext->removeCamera(this); 
>     } 
>     else 
>     { 
>         releaseGLObjects(); 
> 
>     } 
> 
> 
> } 


This does solve the problem. Is it definitely safe it do this, though? What if the camera references stuff still shared by another context (e.g. RTT cameras that get added to and removed from an existing context)? I don't imagine you want to add a regression while fixing this.


Cheers,
Chris

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76507#76507







More information about the osg-users mailing list