summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-08-30 10:12:46 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-08-30 10:50:53 +0200
commit1056d02ee07ab9bba3a4dd9f5fd483d45773e665 (patch)
treed93802a67cb985e47ae8005a2813cc3df84ec830 /src
parent19a0048d1755d127607f66266ab4868191647b3c (diff)
Cause fatal error when trying to make a context current in wrong thread.
Since QOpenGLContext is now a QObject, it needs to be moved to, or created in, the thread where it's going to be used. Change-Id: I7ed12b25e75c84bb12be8c7102e46e9a242fc2df Reviewed-on: http://codereview.qt.nokia.com/3858 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 883b60961e..e61c117bfa 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -226,6 +226,9 @@ bool QOpenGLContext::makeCurrent(QSurface *surface)
if (!d->platformGLContext)
return false;
+ if (thread() != QThread::currentThread())
+ qFatal("Cannot make QOpenGLContext current in a different thread");
+
if (!surface) {
doneCurrent();
return true;