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>
This commit is contained in:
Samuel Rødal 2011-08-30 10:12:46 +02:00 committed by Gunnar Sletta
parent 19a0048d17
commit 1056d02ee0

View File

@ -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;