diff --git a/examples/osgcamera/osgcamera.cpp b/examples/osgcamera/osgcamera.cpp index 4ff9d3f5c..cef070bb3 100644 --- a/examples/osgcamera/osgcamera.cpp +++ b/examples/osgcamera/osgcamera.cpp @@ -309,7 +309,7 @@ int main( int argc, char **argv ) osg::Timer_t previous_tick = start_tick; bool done = false; - unsigned int maxNumFrames = 500; + unsigned int maxNumFrames = 50; // main loop - update scene graph, dispatch frame, wait for frame done. while( !done && frameNumcloseImplementation(); + + osg::notify(osg::NOTICE)<<" - done close context "<<_context<releaseContext(); + } + } } + osg::GraphicsContext* _context; + bool _closeContextOnExit; + }; @@ -65,7 +88,7 @@ GraphicsThread::~GraphicsThread() int GraphicsThread::cancel() { - osg::notify(osg::INFO)<<"Cancelling graphics thread"<(itr->get()); + if (barrier) + { + barrier->release(); + //barrier->invalidate(); + osg::notify(osg::INFO)<<" Invalidating barrier "<release(); @@ -85,7 +124,7 @@ int GraphicsThread::cancel() { // commenting out debug info as it was cashing crash on exit, presumable // due to osg::notify or std::cout destructing earlier than this destructor. - osg::notify(osg::INFO)<<"Waiting for GraphicsThread to cancel"<isRealized()) { _graphicsContext->realize(); + contextRealizedInThisThread = true; } osg::notify(osg::INFO)<<"Doing make current"<makeCurrent(); } - osg::notify(osg::INFO)<<"Doing run"<getName()<getName()<<" "<releaseContext(); - } void SwapBuffersOperation::operator () (GraphicsContext* context) diff --git a/src/osgProducer/GraphicsContextImplementation.cpp b/src/osgProducer/GraphicsContextImplementation.cpp index a264aa656..24420eee2 100644 --- a/src/osgProducer/GraphicsContextImplementation.cpp +++ b/src/osgProducer/GraphicsContextImplementation.cpp @@ -231,7 +231,8 @@ void GraphicsContextImplementation::closeImplementation() { if (!_rs) return; - // need to close render surface... + // close render surface by deleting it + _rs = 0; } void GraphicsContextImplementation::bindPBufferToTextureImplementation(GLenum buffer)