Added include/osg/GLObjects + .cpp which provide osg::flush*DeletedGLObjects() methods.

Added and cleaned up DeleteHandler calls in osgViewer to help avoid crashes on exit.

Changed DatabasePager across to dynamically checcking osg::getCompileContext(..)

Updated wrappers.
This commit is contained in:
Robert Osfield
2007-07-06 13:08:51 +00:00
parent a484b95d3c
commit 6931ae4878
13 changed files with 147 additions and 108 deletions

View File

@@ -19,6 +19,8 @@
#include <osgViewer/api/X11/GraphicsWindowX11>
#include <osgViewer/api/X11/PixelBufferX11>
#include <osg/DeleteHandler>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -1178,6 +1180,12 @@ struct X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSyste
~X11WindowingSystemInterface()
{
if (osg::Referenced::getDeleteHandler())
{
osg::Referenced::getDeleteHandler()->setNumFramesToRetainObjects(0);
osg::Referenced::getDeleteHandler()->flushAll();
}
//osg::notify(osg::NOTICE)<<"~X11WindowingSystemInterface()"<<std::endl;
XSetErrorHandler(0);
}
@@ -1251,7 +1259,15 @@ struct RegisterWindowingSystemInterfaceProxy
~RegisterWindowingSystemInterfaceProxy()
{
osg::notify(osg::INFO)<<"~RegisterWindowingSystemInterfaceProxy()"<<std::endl;
if (osg::Referenced::getDeleteHandler())
{
osg::Referenced::getDeleteHandler()->setNumFramesToRetainObjects(0);
osg::Referenced::getDeleteHandler()->flushAll();
}
osg::GraphicsContext::setWindowingSystemInterface(0);
}
};