aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-08 19:59:08 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-05-11 12:51:19 +0200
commit48980f3b20c237831a78f382afc2df2b9fc643e6 (patch)
tree0345e170b47d7296b84018da3ed8cb7b9e6e954e /src/quick/scenegraph
parent89bf0af005f0dec1b8c6e3e80759cf5b22931c56 (diff)
Check thread->isRunning before posting WMReleaseSwapchainEvent
If the window becomes "obscured" (hidden), rendering (i.e. the render thread) stops. Getting a PlatformSurfaceAboutToBeDestroyed afterwards led to sending (and blocking) the WMReleaseSwapchainEvent to the render thread. This lead to a deadlock. While this is not something that happens normally, the problem is showcased by the "headless" case of the qquickwindow autotest which has a quite aggressive destroy() call on the QQuickWindow. Change-Id: I4726b76646564162af645508e08e35e268fea7e4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 20ed00664a..0a62f85388 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -1413,7 +1413,7 @@ bool QSGThreadedRenderLoop::eventFilter(QObject *watched, QEvent *event)
QQuickWindow *window = qobject_cast<QQuickWindow *>(watched);
if (window) {
Window *w = windowFor(m_windows, window);
- if (w) {
+ if (w && w->thread->isRunning()) {
w->thread->mutex.lock();
w->thread->postEvent(new WMReleaseSwapchainEvent(window));
w->thread->waitCondition.wait(&w->thread->mutex);