aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-06-27 07:35:18 +0200
committerGunnar Sletta <gunnar.sletta@jollamobile.com>2014-07-01 14:18:39 +0200
commitc67af3861f8ecec0eb16808d6d4984eef89db5d1 (patch)
treec3a46c1011f672d705f1346bce58ab82d641c4aa
parent2b0f8a7b8c414c9afe383178a768cbac33f5baae (diff)
Avoid deadlock during window hiding.
Because we do event processing in polishAndSync, hide() or handleObscurity() might have been called by the time we continue execution. We already handled that windowDestroyed() was called. Change-Id: If45bcf3fa18cef1a60ca31bc26d3830045f581d9 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 38318fdd00..f8771e68cf 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -886,6 +886,10 @@ void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window)
w = &m_windows.last();
}
+ // set this early as we'll be rendering shortly anyway and this avoids
+ // specialcasing exposure in polishAndSync.
+ w->thread->window = window;
+
if (w->window->width() <= 0 || w->window->height() <= 0
|| !w->window->geometry().intersects(w->window->screen()->availableGeometry())) {
#ifndef QT_NO_DEBUG
@@ -1074,7 +1078,7 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose)
QSG_GUI_DEBUG(w->window, "polishAndSync()");
QQuickWindow *window = w->window;
- if (!window->isExposed() || !window->isVisible() || window->size().isEmpty()) {
+ if (!w->thread || !w->thread->window) {
QSG_GUI_DEBUG(w->window, " - not exposed, aborting...");
killTimer(w->timerId);
w->timerId = 0;
@@ -1093,7 +1097,7 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose)
QQuickWindowPrivate::get(window)->flushDelayedTouchEvent();
w = windowFor(m_windows, window);
}
- if (!w) {
+ if (!w || !w->thread || !w->thread->window) {
QSG_GUI_DEBUG(w->window, " - removed after event flushing..");
killTimer(w->timerId);
w->timerId = 0;