changeset 614:4ec32d4d0867

cnot
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Apr 2019 16:59:48 +0200
parents 412a2d01a189
children b4de8272e8fb
files Applications/Sdl/SdlOpenGLWindow.cpp
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Sdl/SdlOpenGLWindow.cpp	Tue Apr 30 16:44:23 2019 +0200
+++ b/Applications/Sdl/SdlOpenGLWindow.cpp	Tue Apr 30 16:59:48 2019 +0200
@@ -35,9 +35,6 @@
 
 namespace OrthancStone
 {
-  static boost::mutex  globalMutex_;
-  static bool          globalIsGlewInitialized_ = false;
-  
   SdlOpenGLWindow::SdlOpenGLWindow(const char* title,
                                    unsigned int width,
                                    unsigned int height) :
@@ -56,9 +53,12 @@
     // only be called once an OpenGL is setup.
     // https://stackoverflow.com/a/45033669/881731
     {
-      boost::mutex::scoped_lock lock(globalMutex_);
+      static boost::mutex  mutex_;
+      static bool          isGlewInitialized_ = false;
+  
+      boost::mutex::scoped_lock lock(mutex_);
 
-      if (!globalIsGlewInitialized_)
+      if (!isGlewInitialized_)
       {
         LOG(INFO) << "Initializing glew";
         
@@ -69,7 +69,7 @@
                                           "Cannot initialize glew");
         }
 
-        globalIsGlewInitialized_ = true;
+        isGlewInitialized_ = true;
       }
     }    
 #endif