summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qopenglcontext.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index d64d31a9e8..c5d5490ea0 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -984,11 +984,15 @@ bool QOpenGLContext::makeCurrent(QSurface *surface)
#endif
}
- QOpenGLContext *previous = QOpenGLContextPrivate::setCurrentContext(this);
- if (!d->platformGLContext->makeCurrent(surface->surfaceHandle())) {
- QOpenGLContextPrivate::setCurrentContext(previous);
+ if (!d->platformGLContext->makeCurrent(surface->surfaceHandle()))
return false;
- }
+
+ QOpenGLContextPrivate::setCurrentContext(this);
+#ifndef QT_NO_DEBUG
+ QOpenGLContextPrivate::toggleMakeCurrentTracker(this, true);
+#endif
+
+ d->surface = surface;
static bool needsWorkaroundSet = false;
static bool needsWorkaround = false;
@@ -1030,14 +1034,8 @@ bool QOpenGLContext::makeCurrent(QSurface *surface)
if (needsWorkaround)
d->workaround_brokenFBOReadBack = true;
- d->surface = surface;
-
d->shareGroup->d_func()->deletePendingResources(this);
-#ifndef QT_NO_DEBUG
- QOpenGLContextPrivate::toggleMakeCurrentTracker(this, true);
-#endif
-
return true;
}