diff options
author | Armin Berres <armin.berres@basyskom.de> | 2011-05-02 15:17:39 +0200 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-10 12:54:54 +0200 |
commit | 0b2f70a5de4e7a71da85dac1626a902259042d60 (patch) | |
tree | bbb5cf32862c8d4a86232111b2002fdc58a6faeb /src | |
parent | f1e0993419baded4e4cacbf1ad7e37477f375c94 (diff) |
Only cleanup share widget if it has been created.
Without this change a not yet created share widget is created
once qt_destroy_gl_share_widget() is called. As creating the
widget also triggers a call to qt_cleanup_gl_share_widget() once
QApplication is destroyed a QApplication created afterwards
cannot use a share widget anymore.
This functionality is needed for Harmattan.
Merge-request: 2609
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
(cherry picked from commit 8680d831fb7066feae07690a4a6bc8e908a84e5a)
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 8494283feb..49b3dc2dae 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -184,7 +184,9 @@ QGLGraphicsSystem::QGLGraphicsSystem(bool useX11GL) class QGLGlobalShareWidget { public: - QGLGlobalShareWidget() : firstPixmap(0), widgetRefCount(0), widget(0), initializing(false) {} + QGLGlobalShareWidget() : firstPixmap(0), widgetRefCount(0), widget(0), initializing(false) { + created = true; + } QGLWidget *shareWidget() { if (!initializing && !widget && !cleanedUp) { @@ -223,6 +225,7 @@ public: } static bool cleanedUp; + static bool created; QGLPixmapData *firstPixmap; int widgetRefCount; @@ -233,6 +236,7 @@ private: }; bool QGLGlobalShareWidget::cleanedUp = false; +bool QGLGlobalShareWidget::created = false; static void qt_cleanup_gl_share_widget(); Q_GLOBAL_STATIC_WITH_INITIALIZER(QGLGlobalShareWidget, _qt_gl_share_widget, @@ -242,7 +246,8 @@ Q_GLOBAL_STATIC_WITH_INITIALIZER(QGLGlobalShareWidget, _qt_gl_share_widget, static void qt_cleanup_gl_share_widget() { - _qt_gl_share_widget()->cleanup(); + if (QGLGlobalShareWidget::created) + _qt_gl_share_widget()->cleanup(); } QGLWidget* qt_gl_share_widget() @@ -254,7 +259,8 @@ QGLWidget* qt_gl_share_widget() void qt_destroy_gl_share_widget() { - _qt_gl_share_widget()->destroy(); + if (QGLGlobalShareWidget::created) + _qt_gl_share_widget()->destroy(); } const QGLContext *qt_gl_share_context() |