diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2014-11-16 15:31:12 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-11-17 18:35:52 +0100 |
commit | 5b8966e089016d18d69d6081eba685b5524799dc (patch) | |
tree | 868755ba15422d5ded7e561f771a07e0f0e857bf /src/core/aspects/qaspectengine_p.h | |
parent | b176000312983703f19262664471ccbd3305c259 (diff) |
Cleanly exit the render thread
We have to mutex protect accesses to the m_surface variable in the
Renderer as the main thread may call destroy() on the corresponding
QWindow. This can happen in response to the window being closed or
changing QScreens.
Calling swapBuffers() on a QSurface that has been destroyed does not
fail gracefully but crashes. This change works around this by using
the new QPlatformSurfaceEvent in QtGui which is sent to the window
or offsceen surface when the platform surface has been created or
is about to be destroyed.
This event is used to inform the renderer to stop rendering to the
window surface in a safe manner, before the native surface gets
destroyed.
The Renderer::submitRenderViews() now checks at the start of each
frame that the m_surface is still valid.
There is still another crash at shutdown if applications are
sending a lot of updates to the backend.
Change-Id: I742226c7ae8f657e218cbcd45f0dff3d2b7bcc18
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/aspects/qaspectengine_p.h')
-rw-r--r-- | src/core/aspects/qaspectengine_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/aspects/qaspectengine_p.h b/src/core/aspects/qaspectengine_p.h index 68d0af221..5770937c2 100644 --- a/src/core/aspects/qaspectengine_p.h +++ b/src/core/aspects/qaspectengine_p.h @@ -43,6 +43,7 @@ #define QT3D_QASPECTENGINE_P_H #include <private/qobject_p.h> +#include <Qt3DCore/qaspectengine.h> #include <QtCore/qsharedpointer.h> QT_BEGIN_NAMESPACE |