From Jannik Heller , GL object deletion fix.

"This submission changes deleteGLObject calls to scheduleGLObjectForDeletion, to ensure that the actual deletion happens from the correct thread (the graphics thread). This fixes the leak I reported in http://forum.openscenegraph.org/viewtopic.php?t=15567 , and possibly also http://forum.openscenegraph.org/viewtopic.php?t=15564."
This commit is contained in:
Robert Osfield
2016-02-05 20:29:22 +00:00
parent 8cefa05e3a
commit 3e0435febd
5 changed files with 12 additions and 12 deletions

View File

@@ -67,7 +67,7 @@ void VertexProgram::dirtyVertexProgramObject()
{
if (_vertexProgramIDList[i] != 0)
{
osg::get<GLVertexProgramManager>(i)->deleteGLObject(_vertexProgramIDList[i]);
osg::get<GLVertexProgramManager>(i)->scheduleGLObjectForDeletion(_vertexProgramIDList[i]);
_vertexProgramIDList[i] = 0;
}
}
@@ -157,7 +157,7 @@ void VertexProgram::releaseGLObjects(State* state) const
unsigned int contextID = state->getContextID();
if (_vertexProgramIDList[contextID] != 0)
{
osg::get<GLVertexProgramManager>(contextID)->deleteGLObject(_vertexProgramIDList[contextID]);
osg::get<GLVertexProgramManager>(contextID)->scheduleGLObjectForDeletion(_vertexProgramIDList[contextID]);
_vertexProgramIDList[contextID] = 0;
}
}