summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorTrond Kjernaasen <trond@trolltech.com>2009-09-28 14:52:04 (GMT)
committerTrond Kjernaasen <trond@trolltech.com>2009-09-28 15:03:33 (GMT)
commit14a896cf6b8b67a8d83a6204737249afa9ecd220 (patch)
treefc1989faa3e38afecb9108520f748eef5d694466 /src/opengl/gl2paintengineex
parent00ee879628e392ad46daf9cabe7c760c09afb6b7 (diff)
downloadQt-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/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 119c89d..7e45fd9 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -129,7 +129,7 @@ public Q_SLOTS:
// since the context holding the texture is shared, and
// about to be destroyed, we have to transfer ownership
// of the texture to one of the share contexts
- ctx = const_cast<QGLContext *>(shares.at(0));
+ ctx = const_cast<QGLContext *>((ctx == shares.at(0)) ? shares.at(1) : shares.at(0));
}
}
}