diff --git a/src/osg/State.cpp b/src/osg/State.cpp index 3650d8f2a..b318f20f4 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -132,8 +132,11 @@ State::State(): State::~State() { // delete the GLExtensions object associated with this osg::State. - GLExtensions::Set(_contextID, 0); - _glExtensions = 0; + if (_glExtensions) + { + GLExtensions::Set(_contextID, 0); + _glExtensions = 0; + } //_texCoordArrayList.clear();