diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-10-18 12:06:24 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-18 14:09:16 +0200 |
commit | 12e471b7fd254fa276f19f7c7c980b4cee9ba005 (patch) | |
tree | aaae46afa0164dc07344977bee9997755b58e81f /src | |
parent | cedf0e03d652ea9d712e65f7cce413f3be0009f6 (diff) |
Do not call swapBuffers when surfaceHandle is NULL.
Calling swapBuffers with the surfaceHandle of 0 returned by QWindow
during application exit causes a crash when using GLX. The patch
avoids swapBuffer calls to platformGLContext when there is no surface
handle anymore.
Change-Id: I09c5bbafd4e7af6648ca54a58ed0267d0a2f343d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 2d7a62996c..b3ce22448d 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -290,7 +290,9 @@ void QOpenGLContext::swapBuffers(QSurface *surface) return; } - d->platformGLContext->swapBuffers(surface->surfaceHandle()); + QPlatformSurface *surfaceHandle = surface->surfaceHandle(); + if (surfaceHandle) + d->platformGLContext->swapBuffers(surfaceHandle); } void (*QOpenGLContext::getProcAddress(const QByteArray &procName)) () |