diff options
author | Armin Berres <armin.berres@basyskom.de> | 2011-05-02 13:17:39 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-05-02 13:17:49 (GMT) |
commit | 8680d831fb7066feae07690a4a6bc8e908a84e5a (patch) | |
tree | b4bef7a9d629c120196afab6d13115998dd908f7 /src | |
parent | 2c8df8bfb679885c3cbd2ee02f5e4053fdd554c2 (diff) | |
download | Qt-8680d831fb7066feae07690a4a6bc8e908a84e5a.zip Qt-8680d831fb7066feae07690a4a6bc8e908a84e5a.tar.gz Qt-8680d831fb7066feae07690a4a6bc8e908a84e5a.tar.bz2 |
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>
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 56e2c3b..4a4718b 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() |