diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index 9a6977ed6..0a90cf054 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -517,8 +517,8 @@ void Shader::PerContextShader::compileShader(osg::State& state) if (numFormats>0) { - GLint* formats = new GLint[numFormats]; - glGetIntegerv(GL_SHADER_BINARY_FORMATS, formats); + std::vector formats(numFormats); + glGetIntegerv(GL_SHADER_BINARY_FORMATS, &formats[0]); for(GLint i=0; igetShaderSource().empty()) {