Remove side effects of QGLXContext::queryDummyContext()

Task-number: QTBUG-34782

Change-Id: I411c89238b3002a118b1750af0157ccff5c78712
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
bb10
Sean Harmer 2013-11-12 13:43:37 +00:00 committed by The Qt Project
parent 038b0dae83
commit 9f75292a60
1 changed files with 8 additions and 0 deletions

View File

@ -431,6 +431,11 @@ void QGLXContext::queryDummyContext()
if (skip)
return;
QOpenGLContext *oldContext = QOpenGLContext::currentContext();
QSurface *oldSurface = 0;
if (oldContext)
oldSurface = oldContext->surface();
QOffscreenSurface surface;
surface.create();
QOpenGLContext context;
@ -446,6 +451,9 @@ void QGLXContext::queryDummyContext()
break;
}
}
if (oldContext && oldSurface)
oldContext->makeCurrent(oldSurface);
}
bool QGLXContext::supportsThreading()