diff --git a/src/osg/FragmentProgram.cpp b/src/osg/FragmentProgram.cpp index ba0fe8f74..d5af1e37f 100644 --- a/src/osg/FragmentProgram.cpp +++ b/src/osg/FragmentProgram.cpp @@ -67,7 +67,7 @@ void FragmentProgram::dirtyFragmentProgramObject() { if (_fragmentProgramIDList[i] != 0) { - osg::get(i)->deleteGLObject(_fragmentProgramIDList[i]); + osg::get(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(contextID)->deleteGLObject(_fragmentProgramIDList[contextID]); + osg::get(contextID)->scheduleGLObjectForDeletion(_fragmentProgramIDList[contextID]); _fragmentProgramIDList[contextID] = 0; } } diff --git a/src/osg/FrameBufferObject.cpp b/src/osg/FrameBufferObject.cpp index 301130f87..08501c0f5 100644 --- a/src/osg/FrameBufferObject.cpp +++ b/src/osg/FrameBufferObject.cpp @@ -89,7 +89,7 @@ RenderBuffer::~RenderBuffer() { for(unsigned i=0; i<_objectID.size(); ++i) { - if (_objectID[i]) osg::get(i)->deleteGLObject(_objectID[i]); + if (_objectID[i]) osg::get(i)->scheduleGLObjectForDeletion(_objectID[i]); } } @@ -173,7 +173,7 @@ void RenderBuffer::releaseGLObjects(osg::State* state) const unsigned int contextID = state->getContextID(); if (_objectID[contextID]) { - osg::get(contextID)->deleteGLObject(_objectID[contextID]); + osg::get(contextID)->scheduleGLObjectForDeletion(_objectID[contextID]); _objectID[contextID] = 0; } } @@ -183,7 +183,7 @@ void RenderBuffer::releaseGLObjects(osg::State* state) const { if (_objectID[i]) { - osg::get(i)->deleteGLObject(_objectID[i]); + osg::get(i)->scheduleGLObjectForDeletion(_objectID[i]); _objectID[i] = 0; } } @@ -595,7 +595,7 @@ FrameBufferObject::~FrameBufferObject() { for(unsigned i=0; i<_fboID.size(); ++i) { - if (_fboID[i]) osg::get(i)->deleteGLObject(_fboID[i]); + if (_fboID[i]) osg::get(i)->scheduleGLObjectForDeletion(_fboID[i]); } } @@ -613,7 +613,7 @@ void FrameBufferObject::releaseGLObjects(osg::State* state) const unsigned int contextID = state->getContextID(); if (_fboID[contextID]) { - osg::get(contextID)->deleteGLObject(_fboID[contextID]); + osg::get(contextID)->scheduleGLObjectForDeletion(_fboID[contextID]); _fboID[contextID] = 0; } } @@ -623,7 +623,7 @@ void FrameBufferObject::releaseGLObjects(osg::State* state) const { if (_fboID[i]) { - osg::get(i)->deleteGLObject(_fboID[i]); + osg::get(i)->scheduleGLObjectForDeletion(_fboID[i]); _fboID[i] = 0; } } diff --git a/src/osg/Program.cpp b/src/osg/Program.cpp index f60130a7d..61a9be767 100644 --- a/src/osg/Program.cpp +++ b/src/osg/Program.cpp @@ -689,7 +689,7 @@ Program::PerContextProgram::~PerContextProgram() { if (_ownsProgramHandle) { - osg::get(_contextID)->deleteGLObject(_glProgramHandle); + osg::get(_contextID)->scheduleGLObjectForDeletion(_glProgramHandle); } } diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index 4f936322f..f77249487 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -464,7 +464,7 @@ Shader::PerContextShader::PerContextShader(const Shader* shader, unsigned int co Shader::PerContextShader::~PerContextShader() { - osg::get(_contextID)->deleteGLObject(_glShaderHandle); + osg::get(_contextID)->scheduleGLObjectForDeletion(_glShaderHandle); } diff --git a/src/osg/VertexProgram.cpp b/src/osg/VertexProgram.cpp index a8a45981e..fff581117 100644 --- a/src/osg/VertexProgram.cpp +++ b/src/osg/VertexProgram.cpp @@ -67,7 +67,7 @@ void VertexProgram::dirtyVertexProgramObject() { if (_vertexProgramIDList[i] != 0) { - osg::get(i)->deleteGLObject(_vertexProgramIDList[i]); + osg::get(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(contextID)->deleteGLObject(_vertexProgramIDList[contextID]); + osg::get(contextID)->scheduleGLObjectForDeletion(_vertexProgramIDList[contextID]); _vertexProgramIDList[contextID] = 0; } }