diff options
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 50d0ae7..3a7a07e 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -184,11 +184,13 @@ QGLGraphicsSystem::QGLGraphicsSystem() class QGLGlobalShareWidget { public: - QGLGlobalShareWidget() : widget(0) {} + QGLGlobalShareWidget() : widget(0), initializing(false) {} QGLWidget *shareWidget() { - if (!widget && !cleanedUp) { + if (!initializing && !widget && !cleanedUp) { + initializing = true; widget = new QGLWidget; + initializing = false; } return widget; } @@ -204,6 +206,7 @@ public: private: QGLWidget *widget; + bool initializing; }; bool QGLGlobalShareWidget::cleanedUp = false; |