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:
@@ -67,7 +67,7 @@ void FragmentProgram::dirtyFragmentProgramObject()
|
||||
{
|
||||
if (_fragmentProgramIDList[i] != 0)
|
||||
{
|
||||
osg::get<GLFragmentProgramManager>(i)->deleteGLObject(_fragmentProgramIDList[i]);
|
||||
osg::get<GLFragmentProgramManager>(i)->scheduleGLObjectForDeletion(_fragmentProgramIDList[i]);
|
||||
_fragmentProgramIDList[i] = 0;
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ void FragmentProgram::releaseGLObjects(State* state) const
|
||||
unsigned int contextID = state->getContextID();
|
||||
if (_fragmentProgramIDList[contextID] != 0)
|
||||
{
|
||||
osg::get<GLFragmentProgramManager>(contextID)->deleteGLObject(_fragmentProgramIDList[contextID]);
|
||||
osg::get<GLFragmentProgramManager>(contextID)->scheduleGLObjectForDeletion(_fragmentProgramIDList[contextID]);
|
||||
_fragmentProgramIDList[contextID] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user