diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-11-18 08:53:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-12 08:55:35 +0100 |
commit | 91e2c5d749e38eed93e91b14151faa549e70080f (patch) | |
tree | 7f52a4f1a1106f1e03ebe2b78a9344f646d73762 /src/quick | |
parent | 2818f64cafe1ea249288ca8f572081fc58a10111 (diff) |
Safeguard QQuickWindow::hide() against other GL contexts.
If another GL context is bound to another surface on the GUI
thread, we can run into issues while cleaning up the SG nodes.
Task-number: QTBUG-34898
Change-Id: Ifa02b7cdbc7ab38b3a149a21452cc5071498a7d1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgwindowsrenderloop.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 52df55fa92..ac1bdb7841 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -238,6 +238,8 @@ void QSGGuiThreadRenderLoop::hide(QQuickWindow *window) m_windows.remove(window); QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window); + if (gl) + gl->makeCurrent(window); cd->cleanupNodesOnShutdown(); if (m_windows.size() == 0) { diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 0c128d5cae..0b6d42aca6 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -240,7 +240,11 @@ void QSGWindowsRenderLoop::hide(QQuickWindow *window) if (window->isExposed()) handleObscurity(); + if (!m_gl) + return; + QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window); + m_gl->makeCurrent(window); cd->cleanupNodesOnShutdown(); // If this is the last tracked window, check for persistent SG and GL and |