aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-11-25 11:40:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 17:32:51 +0100
commit2331a5ef5765d1b99472cd05e1af4b84d59c0177 (patch)
treebbb1d344b052d47bee6d474f839565c81b5088a2 /src/quick
parentc81632df3e9d52011487cfe0bd2e40ba5c5f2d54 (diff)
Stop render thread regardless when the window is being destroyed
When a window is shown and quickly hidden again we can get to a state, on a asynchronous windowing system API, where the isExposed=true event has been pushed to the event queue but not yet processed at the time the user calls hide(). As hide() immediately sets isVisible() to false, we end up with isExposed=true and isVisible=false which prevent the WM_Obscure event to be sent to render loop which means the render thread thought the window was still on screen when we reched the shutdown in WM_TryRelease. Changed WM_TryRelease handling to disregard window state when the window is being deleted. This forces SG and GL cleanup and stops the thread. Task-number: QTBUG-35055 Change-Id: Ibac5aa27354d6450f30a61450214cb785ab855bf Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index bca7736e79..850a463c3e 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -402,8 +402,8 @@ bool QSGRenderThread::event(QEvent *e)
case WM_TryRelease: {
QSG_RT_DEBUG("WM_TryRelease");
mutex.lock();
- if (!window) {
- WMTryReleaseEvent *wme = static_cast<WMTryReleaseEvent *>(e);
+ WMTryReleaseEvent *wme = static_cast<WMTryReleaseEvent *>(e);
+ if (!window || wme->inDestructor) {
QSG_RT_DEBUG(" - setting exit flag and invalidating GL");
invalidateOpenGL(wme->window, wme->inDestructor);
active = gl;