diff options
author | Trond Kjernaasen <trond@trolltech.com> | 2009-09-28 14:52:04 (GMT) |
---|---|---|
committer | Trond Kjernaasen <trond@trolltech.com> | 2009-09-28 15:03:33 (GMT) |
commit | 14a896cf6b8b67a8d83a6204737249afa9ecd220 (patch) | |
tree | fc1989faa3e38afecb9108520f748eef5d694466 /src/opengl/qgl.cpp | |
parent | 00ee879628e392ad46daf9cabe7c760c09afb6b7 (diff) | |
download | Qt-14a896cf6b8b67a8d83a6204737249afa9ecd220.zip Qt-14a896cf6b8b67a8d83a6204737249afa9ecd220.tar.gz Qt-14a896cf6b8b67a8d83a6204737249afa9ecd220.tar.bz2 |
Fixed a crash in the boxes demo when using -graphicssystem opengl.
Several problems:
1. The demo leaked the scene contents, which caused cleanup problems.
2. The QGLContext::currentContext() could be changed behind Qt's back
under Windows (the temp contexts never reset the current context).
3. QGLFormat::openGLVersionFlags() function would return uninitialized
flags if the QGLWidget constructor happened to call
qt_gl_preferGL2Engine().
Reviewed-by: Kim
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 97a4a73..0ad6772 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1245,11 +1245,11 @@ QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags() if (cachedDefault) { return defaultVersionFlags; } else { - cachedDefault = true; if (!hasOpenGL()) return defaultVersionFlags; dummy = new QGLWidget; dummy->makeCurrent(); // glGetString() needs a current context + cachedDefault = true; } } |