mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-19 15:09:43 +00:00
Merge branch 'AnyOldName3-master-patch-00511' into 'master'
Add default font releaseGLObjects workaround for OSG <3.65 Closes #4704 See merge request OpenMW/openmw!160
This commit is contained in:
commit
3ce3f364ea
1 changed files with 8 additions and 0 deletions
|
@ -100,6 +100,14 @@ RenderWidget::~RenderWidget()
|
|||
try
|
||||
{
|
||||
CompositeViewer::get().removeView(mView);
|
||||
|
||||
#if OSG_VERSION_LESS_THAN(3,6,5)
|
||||
// before OSG 3.6.4, the default font was a static object, and if it wasn't attached to the scene when a graphics context was destroyed, it's program wouldn't be released.
|
||||
// 3.6.4 moved it into the object cache, which meant it usually got released, but not here.
|
||||
// 3.6.5 improved cleanup with osgViewer::CompositeViewer::removeView so it more reliably released associated state for objects in the object cache.
|
||||
osg::ref_ptr<osg::GraphicsContext> graphicsContext = mView->getCamera()->getGraphicsContext();
|
||||
osgText::Font::getDefaultFont()->releaseGLObjects(graphicsContext->getState());
|
||||
#endif
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue