Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50955 - sandbox/guigl/libs/guigl/src
From: stipe_at_[hidden]
Date: 2009-02-01 13:21:34


Author: srajko
Date: 2009-02-01 13:21:34 EST (Sun, 01 Feb 2009)
New Revision: 50955
URL: http://svn.boost.org/trac/boost/changeset/50955

Log:
glut instance allocated as a function static variable so it is destroyed on program completion
Text files modified:
   sandbox/guigl/libs/guigl/src/window.cpp | 7 ++++++-
   1 files changed, 6 insertions(+), 1 deletions(-)

Modified: sandbox/guigl/libs/guigl/src/window.cpp
==============================================================================
--- sandbox/guigl/libs/guigl/src/window.cpp (original)
+++ sandbox/guigl/libs/guigl/src/window.cpp 2009-02-01 13:21:34 EST (Sun, 01 Feb 2009)
@@ -72,7 +72,7 @@
         : m_window(ptr)
     {
         if(!s_glut)
- s_glut = new glut();
+ initialize_s_glut();
         m_label = map[_label];
         m_id = s_glut->create_window(map[_size], m_label, map[_depth], this);
     }
@@ -123,6 +123,11 @@
     { return m_id; }
     static glut *s_glut;
 private:
+ void initialize_s_glut()
+ {
+ static glut s_glut_impl;
+ s_glut = &s_glut_impl;
+ }
     int m_id;
     window *m_window;
     std::string m_label;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk