From 804f7622cc5399397a0bdd2af35557c6fda5c330 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 17 Aug 2009 15:22:01 +0000 Subject: [PATCH] Moved static string initialization into singleton method --- src/osg/GLExtensions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index 7d8a1682e..3a8fd4994 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -39,9 +39,6 @@ static osg::buffered_object s_gluExtensionSetList; static osg::buffered_object s_gluRendererList; static osg::buffered_value s_gluInitializedList; -static const char* envVar = getenv("OSG_GL_EXTENSION_DISABLE"); -static std::string s_GLExtensionDisableString(envVar?envVar:"Nothing defined"); - float osg::getGLVersionNumber() { // needs to be extended to do proper things with subversions like 1.5.1, etc. @@ -232,6 +229,9 @@ void osg::setGLExtensionDisableString(const std::string& disableString) std::string& osg::getGLExtensionDisableString() { + static const char* envVar = getenv("OSG_GL_EXTENSION_DISABLE"); + static std::string s_GLExtensionDisableString(envVar?envVar:"Nothing defined"); + return s_GLExtensionDisableString; }